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

chore: benches_rt/tokio: set event_interval to 1 #257

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Conversation

kanarus
Copy link
Member

@kanarus kanarus commented Aug 28, 2024

I found that in very simple senario, like getting a path param and echoing it as text, the higher setting event_interval of tokio runtime, the lower the performance be.
So this PR tries setting it to the minimum value, 1, in benches_rt/tokio/src/bin/param ( default: 61 ).

ref: https://docs.rs/tokio/1.39.3/tokio/runtime/struct.Builder.html#method.event_interval

benchmark examples

wrk -H 'Connection: keep-alive' --connections 32 --threads 16 --duration 3s --timeout 1s 'http://localhost:3000/user/1234567890987654321'
  • default ( #[tokio::main] async fn main() )

    1. Requests/sec: 725217.89
    2. Requests/sec: 726961.24
    3. Requests/sec: 724529.73
  • set event_interval to 1 ( .event_interval(1) )

    1. Requests/sec: 874318.85
    2. Requests/sec: 865562.96
    3. Requests/sec: 848599.67

@kanarus kanarus merged commit 610e34e into main Aug 28, 2024
3 checks passed
@kanarus kanarus deleted the chore/benchs_rt branch August 28, 2024 21:52
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.

1 participant