ipfs / ipfs/boxo

Bitswap client CPU hotspots

Open
#296 1 comment 0 reactions 0 assignees View on GitHub
need/triage
Dominant language
Go
Stars
316
Forks
163
Avg merge
4d 12h
Merged PRs (30d)
8

Description

# 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](https://github.com/ipfs/boxo/assets/1450680/4792111b-4198-481e-8842-2770451b8c53)
Source data:
[cpu.pprof.zip](https://github.com/ipfs/boxo/files/11444857/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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.