ipfs / rainbow

A specialized IPFS HTTP gateway
https://docs.ipfs.tech/reference/http/gateway/
Other
66 stars 11 forks source link

Histogram buckets are too small #135

Closed 2color closed 1 month ago

2color commented 2 months ago

Problem

HTTP gateway requests for non-cached blocks can often take much longer than a couple of seconds. In fact, it's not uncommon for them to take ~60 seconds or more.

Given that, the current bucket configuration for the histograms exposed by Rainbow don't make sense, since their tuned for much quicker responses which are rather unlikely in an uncontrolled peer-to-peer network:

https://github.com/ipfs/rainbow/blob/ad18bc8308cb352329258580e2dd98ec633b1aa4/metrics.go#L29

Suggestion

Add a bunch of larger bucket sizes, like we do in boxo:

https://github.com/ipfs/boxo/blob/0f223aada9b8beefe449b94ee9601d917f482121/gateway/metrics.go#L17-L20

Related: https://github.com/ipshipyard/waterworks-infra/issues/141