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

Lower http worker thread priority #14556

Closed
ryoqun opened this issue Jan 13, 2021 · 2 comments · Fixed by #21019
Closed

Lower http worker thread priority #14556

ryoqun opened this issue Jan 13, 2021 · 2 comments · Fixed by #21019
Labels
locked issue security Pull requests that address a security vulnerability
Milestone

Comments

@ryoqun
Copy link
Member

ryoqun commented Jan 13, 2021

Problem

http worker thread are scheduled equally as other threads. This can stall the validator pretty easily by indirectly chogging the machine via cpu usage saturation.

If I manually reniced the http threads*, I observed generally more favorable validator sync status even under the heavy load of rpc reqs.

*: $ ps -e -T | grep http | awk '{print $2}' | while read pid; do sudo renice -n 20 -p $pid; done

Proposed Solution

Just lower the thread priority via some platform-dependant crate.

Be careful a bit for the lock priority inversion; but it should generally better than nothing.
At least, we just need dictonomy of critical replay threads (including account background service) and other threads (http worker) and make sure replay threads never depend on other threads. (strictly, it does still via AccountsDB locks).

Also, as far as I checked our rpc generally doesn't lock except obvious one (like getProgramAccounts).
So, not that super high priority.
Anyway, I managed the validator with getConfirmedBlock, so lowering serialization done by the http worker thread will be one of the few wins from here.

@ryoqun ryoqun added the security Pull requests that address a security vulnerability label Jan 13, 2021
@mvines mvines added this to the The Future! milestone May 10, 2021
im-0 added a commit to im-0/solana that referenced this issue Oct 27, 2021
im-0 added a commit to im-0/solana that referenced this issue Oct 27, 2021
@im-0
Copy link
Contributor

im-0 commented Oct 27, 2021

Please check #21019

im-0 added a commit to im-0/solana that referenced this issue Oct 28, 2021
im-0 added a commit to im-0/solana that referenced this issue Oct 28, 2021
im-0 added a commit to im-0/solana that referenced this issue Oct 29, 2021
im-0 added a commit to im-0/solana that referenced this issue Oct 29, 2021
im-0 added a commit to im-0/solana that referenced this issue Nov 3, 2021
im-0 added a commit to im-0/solana that referenced this issue Nov 3, 2021
im-0 added a commit to im-0/solana that referenced this issue Nov 11, 2021
mvines pushed a commit that referenced this issue Nov 15, 2021
… threads (v1.8) (#21020)

* Add function for changing thread's nice value

Linux only.

* Add validator option to change niceness of snapshot packager thread

* Add validator option to change niceness of RPC server threads

Fixes #14556

* Run `./scripts/cargo-for-all-lock-files.sh tree`
dankelleher pushed a commit to identity-com/solana that referenced this issue Nov 24, 2021
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked issue security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants