Today I would like to try Redis, wrote a program, for Redis continuous 100000 access, but appeared to cannot assign requested address problem, I initially thought is the problem of redis (may not withstand so much traffic), But Redis was blown by everyone so NB, will not appear so SB's problem, so Google, found that the original is:
Clients frequently connect the server, because each connection in a very short period of time, resulting in a lot of time_wait, so that the use of the port number, so the new connection is not bound to the port, that is, "cannot assign requested address." The problem with the client is not the server side. Through netstat, you do see a lot of time_wait state connections.
Find a solution from the Internet:
Execute the command to modify the following 2 kernel parameters
Sysctl-w Net.ipv4.tcp_timestamps=1 turn on support for TCP timestamps, if the entry is set to 0, the following setting does not work
Sysctl-w net.ipv4.tcp_tw_recycle=1 for fast recovery of time-wait sockets in a TCP connection
However, it seems that only the root user can modify the permissions of these two parameters, I happen to have the root authority of the machine, modify it, found, really can.
However, if there is no root authority how to solve, can be modified by the program to get it is not known. Hope that the expert to see after pointing!
Cannot assign requested address solution