boxo icon indicating copy to clipboard operation
boxo copied to clipboard

Bitswap client CPU hotspots

Open hannahhoward opened this issue 2 years ago • 1 comments

Goals

Under heavy load, we're seeing high CPU usage in Lassie originating in Bitswap. Looks like a couple functions are pretty heavy CPU consumers:

  • SessionInterestManager.RemoveSession
  • MessageQueue.ExtractOutgoingMessage (and Wantlist.Entries within it) This pushes us towards 700%+ CPU usage on a Saturn node that affects overall performance.

Pprof visualization: profile001 Source data: cpu.pprof.zip Lassie binaries (this is from the x86_64 build we think): https://github.com/filecoin-project/lassie/releases/tag/v0.9.2

I suspect these hotspots are pretty common to heavy bitswap client usage and are worth optimizing.

hannahhoward avatar May 10 '23 18:05 hannahhoward

Obviously not good to have these hotspots. Unless these are blocking anyone right now, I'm not planning for us to do them as part of the current Kubo/Boxo "0.21 iteration" given the other tasks we already have assigned. I am noting it for larger "bitswap overhaul" work that we want to sink into later in the year.

BigLep avatar May 17 '23 16:05 BigLep