Files
pezkuwi-subxt/prdoc/pr_3190.prdoc
T
eskimor b74353d3e9 Fix algorithmic complexity of on-demand scheduler with regards to number of cores. (#3190)
We witnessed really poor performance on Rococo, where we ended up with
50 on-demand cores. This was due to the fact that for each core the full
queue was processed. With this change full queue processing will happen
way less often (most of the time complexity is O(1) or O(log(n))) and if
it happens then only for one core (in expectation).

Also spot price is now updated before each order to ensure economic back
pressure.


TODO:

- [x] Implement
- [x] Basic tests
- [x] Add more tests (see todos)
- [x] Run benchmark to confirm better performance, first results suggest
> 100x faster.
- [x] Write migrations
- [x] Bump scale-info version and remove patch in Cargo.toml
- [x] Write PR docs: on-demand performance improved, more on-demand
cores are now non problematic anymore. If need by also the max queue
size can be increased again. (Maybe not to 10k)

Optional: Performance can be improved even more, if we called
`pop_assignment_for_core()`, before calling `report_processed` (Avoid
needless affinity drops). The effect gets smaller the larger the claim
queue and I would only go for it, if it does not add complexity to the
scheduler.

---------

Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: antonva <anton.asgeirsson@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
Co-authored-by: ordian <write@reusable.software>
2024-03-20 13:53:55 +00:00

18 lines
757 B
Plaintext

# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
title: Fix algorithmic complexity of the on-demand scheduler.
doc:
- audience: Runtime Dev
description: |
Improves on demand performance by a significant factor. Previously, having many on-demand cores
would cause really poor blocktimes due to the fact that for each core the full order queue was
processed. This allows for increasing the max size of the on-demand queue if needed.
At the same time, the spot price for on-demand is now checked prior to every order, ensuring
that economic backpressure will be applied.
crates:
- name: polkadot-runtime-parachains