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

reuseaddr setting to true cased eaddrnotavail in SOCKET_OPTS #61

Open
hellowenniu opened this issue Oct 23, 2014 · 2 comments
Open

reuseaddr setting to true cased eaddrnotavail in SOCKET_OPTS #61

hellowenniu opened this issue Oct 23, 2014 · 2 comments

Comments

@hellowenniu
Copy link

Hi,

The concurrent connections in my project was about 30,000. I could find CRASH: {connection_error,{connection_error,eaddrnotavail}} in a percentage of 0.1%.
The reuseaddr is set to true and looks like it is the root cause. The client would try to reuse the same port in time_wait status, but encounters eaddrnotavail error.
Please refer to http://stackoverflow.com/questions/17606503/redis-exception-raised-in-gen-server/26523211#26523211

After change the code to:
-define(SOCKET_OPTS, [binary, {active, once}, {packet, raw}, {reuseaddr, false}]).
There is no more eaddrnotavail error.

@olgeni
Copy link
Contributor

olgeni commented Aug 26, 2016

Is eredis still alive?

@knutin
Copy link
Collaborator

knutin commented Aug 26, 2016

@olgeni: Yes, I'd say so :) I remember a case where you'd want to enable reuseaddr. I think maybe it was in the unit tests. Are the tests still passing on your branch?

@hellowenniu: It makes sense to fix this issue, either by setting the setting to false or allow it to be configurable. Just out of curiosity, how many Redis instances do you have? And are you using MULTI? A single connection to each instance should give you very good performance if you're using the simple commands, so no MULTI or blocking commands.

knutin added a commit that referenced this issue Aug 15, 2017
Disable reuseaddr in SOCKET_OPTS (issue #61).
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

3 participants