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

Set semaphore to 2 for "request_task" API #2016

Merged
merged 1 commit into from
May 16, 2024

Conversation

ppigazzini
Copy link
Collaborator

Tested working fine with a fleet of 75k cores 10k machines,
Waitress configured with threads=4 and connection_limit=100
HW usage: RAM 72%, primary Waitress instance CPU 85-95%

This is a good compromise for threads "privileged" for "request_task" API, and threads free for any other APIs, while keeping Waitress threads=4.

Raising the number of Waitress threads uses more RAM and can requires lowering the MongoDB cache size to avoid the OOM killer.

see #2003

Tested working fine with a fleet of 75k cores 10k machines,
Waitress configured with threads=4 and connection_limit=100
HW usage: RAM 72%, primary Waitress instance CPU 85-95%

This is a good compromise for threads "privileged" for "request_task" API,
and threads free for any other APIs, while keeping Waitress threads=4.

Raising the number of Waitress threads uses more RAM and can
requires lowering the MongoDB cache size to avoid the OOM killer.

see official-stockfish#2003

Drop old mongodb requirement.
@ppigazzini ppigazzini added enhancement server server side changes labels May 16, 2024
@ppigazzini ppigazzini merged commit df34bdc into official-stockfish:master May 16, 2024
19 checks passed
@ppigazzini ppigazzini deleted the semaphore_2 branch May 16, 2024 11:51
@ppigazzini ppigazzini added the scaling handle >> 1M worker cores label May 16, 2024
@xoto10
Copy link
Contributor

xoto10 commented May 18, 2024

Nice :)

Do we have any information on how long the request_task calls take if rejected by the semaphore?

I assume it's very fast, but it helps to theorise about what's happening if we had a rough idea of the real number.

@vondele
Copy link
Member

vondele commented May 18, 2024

Do we have any information on how long the request_task calls take if rejected by the semaphore?

handled in 370.54ms (server: 210.34ms)
handled in 319.99ms (server: 151.06ms)
handled in 339.38ms (server: 158.88ms)
handled in 280.25ms (server: 52.08ms)
handled in 235.64ms (server: 1.82ms)
handled in 446.53ms (server: 1.25ms)
handled in 484.77ms (server: 8.73ms)
handled in 798.18ms (server: 138.25ms)
handled in 292.24ms (server: 119.02ms)
handled in 376.86ms (server: 0.72ms)
handled in 1307.80ms (server: 5.86ms)
handled in 406.99ms (server: 1.32ms)
handled in 155.74ms (server: 6.02ms)
handled in 551.27ms (server: 278.69ms)
handled in 405.88ms (server: 0.93ms)
handled in 534.28ms (server: 253.10ms)

so probably 1ms on reject, 150ms on average when passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement scaling handle >> 1M worker cores server server side changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants