Skip to content

Comments

bitswap: add requestsInFlight metric#904

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

bitswap: add requestsInFlight metric#904
hsanjuan merged 2 commits intomainfrom
bitswap/requests-in-flight

Conversation

@hsanjuan
Copy link
Contributor

@hsanjuan hsanjuan commented Mar 31, 2025

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
13 checks passed
@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