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

flush_interval for ReqSocket and RepSocket #14

Closed
4 tasks
mempirate opened this issue Oct 19, 2023 · 9 comments
Closed
4 tasks

flush_interval for ReqSocket and RepSocket #14

mempirate opened this issue Oct 19, 2023 · 9 comments
Assignees
Labels
A-socket Area: Sockets C-feature Category: Feature M-good-first-issue Meta: Good first issue
Milestone

Comments

@mempirate
Copy link
Contributor

mempirate commented Oct 19, 2023

Same as with the PubSocket, any high-throughput socket writer should have an optional flush_interval in the options that should be respected when flushing the Framed connection. Calling flush too often adds a lot of syscall overhead as discussed in #11.

The default here should actually be None imo, and flushing should happen after every send, since the usual behaviour for request response (at least in our case) will be low-latency and low throughput. But it should be configurable for other use cases nonetheless. The benchmarks should also play around with this option.

Tasks

@mempirate mempirate added C-feature Category: Feature M-good-first-issue Meta: Good first issue A-socket Area: Sockets labels Oct 19, 2023
@mempirate mempirate added this to the v0.1.1-alpha milestone Oct 19, 2023
@PatStiles
Copy link
Contributor

Interested!

@mempirate mempirate self-assigned this Oct 21, 2023
@mempirate
Copy link
Contributor Author

mempirate commented Oct 21, 2023

Assigned! You can take a look at how it's done in the publisher here: #24

@mempirate mempirate assigned PatStiles and unassigned mempirate Oct 21, 2023
@quangkeu95
Copy link
Contributor

quangkeu95 commented Nov 6, 2023

Is this issue still available? I can work on this

@mempirate
Copy link
Contributor Author

@PatStiles if you currently don't have the bw for this, let me know and I'll assign @quangkeu95

@quangkeu95
Copy link
Contributor

I tried to create a PR here, so any feedbacks is appreciated!

@quangkeu95
Copy link
Contributor

what is your device spec that you are using to run the benchmark @jonasbostoen ? I tried to run the benchmark for reqrep but cannot achieve the results in the msg/benches/reqrep.rs file. Currently running on Macbook Pro 2019 with Intel i9 2.3Ghz 8-Core

@mempirate
Copy link
Contributor Author

mempirate commented Nov 7, 2023

@quangkeu95 running on M1 Macbook Pro.

I ran the benchmark again, and when setting flush_interval to 50 microseconds on the ReqSocket, I get a pretty good throughput improvement:

Multi-threaded benchmarks
Before: 249.6 ms, 102.5 MB/s, 200.2 Kitem/s
After: 197.8ms, 129.4 MB/s, 252.7 Kitem/s

However, when I set the option on the RepSocket, throughput tanks by around 70%. I'm not sure why, and will investigate later, but for now I think we should remove the option on RepOptions.

@quangkeu95
Copy link
Contributor

quangkeu95 commented Nov 7, 2023

Let me take a look, if the performance is decreased then we could consider remove the option in RepOptions.

mempirate added a commit that referenced this issue Nov 8, 2023
`flush_interval` for `ReqSocket` and `RepSocket` #14
@mempirate
Copy link
Contributor Author

Fixed by #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-socket Area: Sockets C-feature Category: Feature M-good-first-issue Meta: Good first issue
Projects
None yet
Development

No branches or pull requests

3 participants