When centos is used as the server, the server may sometimes reject the connection from the client. The client may suffer Connection reset by peer errors. The reason should be that the default file descriptor of the server is 1024, at this time, it has exceeded 1024, which is caused by Server Denial of Service for security reasons.
Add file descriptor as follows:
1. Temporarily add file descriptor
Ulimit-N 4096
2. Add file descriptor permanently
2.1 # vi/etc/sysctl. conf
2.2 increaseFS. File-max = 100000
2.3 restart or execute# Sysctl-P
2.4# Vi/etc/security/limits. conf
2.5 added *-nofile 100000
2.6 Use ulimit-N to verify file descriptor
References:
Http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
Http://sdb.open-xchange.com/node/35
Http://thedaneshproject.com/posts/how-to-increase-total-file-descriptors-count-on-linux/
Http://www.centos.org/docs/5/html/CDS/install/8.0/Installation_Guide-Support-Platforms.html