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

Update moodycamel to control MAX_SEMA_SPINS #56

Closed
itrofimow opened this issue Jul 21, 2022 · 3 comments
Closed

Update moodycamel to control MAX_SEMA_SPINS #56

itrofimow opened this issue Jul 21, 2022 · 3 comments
Assignees

Comments

@itrofimow
Copy link
Contributor

itrofimow commented Jul 21, 2022

You see, moodycamel::BlockingConcurrentQueue spins here before going to kernel semaphore
and although it's preferable for maximum throughput in benchmarks,
it wastes CPU cycles in some real-life scenarios.

Since this commit there is a way to control this spinning behavior, which was very noticeable in some perfs, remember @apolukhin?

@apolukhin apolukhin self-assigned this Jul 22, 2022
@apolukhin apolukhin added enhancement good first issue Good small issue for newcomers labels Jul 22, 2022
apolukhin added a commit that referenced this issue Jul 26, 2022
References: #56

Tests: протестировано CI
Relates: TAXICOMMON-5485
@apolukhin apolukhin removed the good first issue Good small issue for newcomers label Jul 31, 2022
@apolukhin
Copy link
Member

We've updated the moodycamel.

Now we have three different opinions on MAX_SEMA_SPINS proper value: 0|1, 16, default|10000. We need to do some experiments on production service...

@itrofimow
Copy link
Contributor Author

We've updated the moodycamel.

Now we have three different opinions on MAX_SEMA_SPINS proper value: 0|1, 16, default|10000. We need to do some experiments on production service...

I feel more like ~1000, but that is based purely on feeling.

This definitely requires some experementation, but having a possibility to control that is already a pleasant enhancement, thank you for that!

@apolukhin
Copy link
Member

I'll close this for now. Experiments with MAX_SEMA_SPINS would be done in a few months

YaImedgar pushed a commit to chistopat/userver that referenced this issue Dec 28, 2022
References: userver-framework#56

Tests: протестировано CI
Relates: TAXICOMMON-5485
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

No branches or pull requests

2 participants