Cannot assign requested address solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.