Skip to content

bitswap: add requestsInFlight metric - #904

Merged
hsanjuan merged 2 commits into
mainfrom
bitswap/requests-in-flight
Apr 1, 2025
Merged

hsanjuan merged 2 commits into
mainfrom
bitswap/requests-in-flight

Conversation

@hsanjuan

@hsanjuan hsanjuan commented Mar 31, 2025 •

Copy link
Copy Markdown
Contributor

This metric mimics requestsInFlight in httpnet.

It should tell how many streams are being written or read at a given time, just like in HTTP we measure how many requests are ongoing at a given time.

The main insight is knowing with how many "workers" (or how much concurrency) bitswap is using for writing/reading wantlists to/from other hosts. It should roughly match the following, if both things have the same performance:

bitswapRequestsInFlight = elementsInWantlist * httpRequestsInFlight

However, since httpRequestsInFlight is limited by the number of http workers, it may signal that the number of workers is too low to compete with bitswap and that it should increase to make better use of available concurrent stream capacities.

cc ipshipyard/roadmaps#17

This metric mimics requestsInFlight in httpnet.

It should tell how many streams are being written or read at a given time,
just like in HTTP we measure how many requests are ongoing at a given time.

The main insight is knowing with how many "workers" (or how much concurrency) bitswap is using
for writing/reading wantlists to/from other hosts. It should roughly match the following, if both
things have the same performance:

bitswapRequestsInFlight = elementsInWantlist * httpRequestsInFlight

However, since httpRequestsInFlight is limited by the number of http workers, it may signal
that the number of workers is too low to compete with bitswap and that it should increase to
make better use of available concurrent stream capacities.
@hsanjuan
hsanjuan requested a review from a team as a code owner March 31, 2025 13:25
@hsanjuan
hsanjuan merged commit fcc26de into main Apr 1, 2025
@hsanjuan
hsanjuan deleted the bitswap/requests-in-flight branch April 1, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants