Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clay/gall: make pings fast #6588

Merged
merged 1 commit into from
May 16, 2023
Merged

Clay/gall: make pings fast #6588

merged 1 commit into from
May 16, 2023

Conversation

philipcmonk
Copy link
Contributor

Meta: this is hotpatched directly onto ~dem. Nothing should be released before this, or if it is, then this should be re-hotpatched onto ~dem.

Galaxies process a lot of pings, and in 413K, the time required to process pings regressed by roughly 10x, to around 30-40ms each. In the 413K refactoring around requests for remote scry, we started checking whether a requested hash was in the "reachable takos" of a desk before we could approve the request. Unfortunately, for many live ships, this process takes more than 10ms.

There are several possible mitigations, two of which are implemented here.

  • First, the ping requests use the %noun mark, and Gall dutifully tries to build the %noun mark in order to validate that the untyped noun it received is in fact an untyped noun. There's no point to that, so this PR short-circuits in that case.
  • Second, the check for reachable takos computes all the reachable takos before checking against any of them. Most of the time, we'll be requesting something from a numbered commit, and those are the easy to check, so this PR adds a short-circuit check for those. This reduces the overall runtime of most Clay cache hits by around 30x on ~dem.
  • Third, reachable takos is a pretty common operation, and it would probably be worth maintaining an index or cache of that request.
  • Fourth, pings should be almost always handled in the runtime, only going into arvo when the lane changes. This will add several orders of magnitude to our ping handling capacity.

My tests indicate that the changes in this PR reduce ~dem's ping processing times from about 45ms to 4-5ms.

Separately, I would expect anything that makes a lot of Clay requests, even if they're mostly cache hits, to be significantly sped up by this PR.

@philipcmonk philipcmonk requested a review from joemfb May 15, 2023 23:43
Copy link
Member

@joemfb joemfb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will do

@belisarius222 belisarius222 merged commit 9804a11 into develop May 16, 2023
1 check passed
@belisarius222 belisarius222 deleted the philip/clay branch May 16, 2023 15:22
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.

None yet

3 participants