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

adding TCP_NODELAY socket flag #33

Open
wants to merge 2 commits into
base: develop
from
Open

Conversation

@mentaal
Copy link
Contributor

mentaal commented Jun 20, 2018

I had noticed that the transaction rate I was achieving in ERPC was very low, around 20 transactions/sec.
After debugging the code and eliminating the code from being the source of the latency, I asked on SO what the problem could be and Nagle's algorithm was suggested as being a culprit. This makes sense as ERPC's header transmission is very small.

See the full legwork in the SO question here.

With this change my transaction rate went from ~20 to 2500+.

@mentaal
Copy link
Contributor Author

mentaal commented Jun 20, 2018

mmm is netinet/tcp.h not present in the build environment?

@Hadatko
Copy link
Member

Hadatko commented Jun 20, 2018

It has to be there, otherwise error would be with not found include. Looks like Max issue.
Guys here made some redefine: Homebrew/legacy-homebrew#44018

@mentaal
Copy link
Contributor Author

mentaal commented Jun 20, 2018

Max issue?

@Hadatko
Copy link
Member

Hadatko commented Jul 3, 2018

Mac OSx issue. Sorry.

@mentaal
Copy link
Contributor Author

mentaal commented Jul 4, 2018

Any ideas on what I can do to get this branch working regarding tests?

@Hadatko
Copy link
Member

Hadatko commented Jul 11, 2018

In a link i sent you they made this:
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
#endif
I am not sure if it is best solution. What do you think?

@mentaal
Copy link
Contributor Author

mentaal commented Jul 15, 2018

Good point. I didn't know it was a linux specific option. That sounds like a good way to go about it.
(Here's a related SO question: https://stackoverflow.com/questions/12112310/is-there-a-way-to-access-the-sol-tcp-aka-ipproto-tcp-socket-options-e-g-tcp)
I'll make the change

…r referenced header is missing
@SASIDHARAN-dot
Copy link

SASIDHARAN-dot commented Dec 18, 2019

TCP_NODELAY has to set on both client and server socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.