oxidecomputer / oxidecomputer/crucible

upstairs perf: too many job-scans in gone_too_long

Open
#785 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
260
Forks
34
Avg merge
2d 1h
Merged PRs (30d)
8

Description

fair bit of time in total_live_work at low IO request sizes with my crudd tests. 15% of the flamegraph at 256-block requests, and like 40% at 16-block requests.

thats getting called in gone_too_long after every process_new_io. the point of gone_too_long is to see if there's too many outstanding IOs (1000) to mark the downstairs as being problematic. and i wonder if we could just like. call it a little less frequently.

https://github.com/oxidecomputer/crucible/blob/6bd7f6e2a53e2558827d82b88fe5ecee3102d880/upstairs/src/lib.rs#L10017-L10023

flamegraphs, if you want to see them for yourself:

2023-05-17-crudd-full-flamegraph.zip

these are a couple weeks old at this point but were run on perfwork before it was merged, iirc.

anyways, we could maybe try to re-invent total_live_work to not be linearly traversing the set of jobs via more accounting variables. or maybe we could just call it less often. i dont think we need to call it after every single IO request comes in from the guest.

Something like running it when an IO request comes in, but only if its been EITHER <some period of time> since the last time we ran it OR <some amount of issued requests since we last ran it> might be a bit nicer, while still catching a wedged downstairs early enough that it doesn't become a problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in upstairs/src/lib.rs around lines 10017-10023 and trace process_new_io, gone_too_long, and total_live_work. Review the linked flamegraph and determine whether reducing call frequency or changing the accounting approach preserves the check for too many outstanding I/Os while reducing job scans.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.