Article Title: Modify the linux file descriptor. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
By default, the file descriptor in linux is 1024. For squid and other services, this file descriptor is far from enough in the case of heavy load, therefore, it is necessary to modify the file descriptor. in linux, there are two ways to modify the file descriptor.
1. Use the ulimit command to modify
// Display the current file descriptor
Ulimit-n
// Modify the file descriptor of the current user environment to 65536
Ulimit-HSn 65536
Disadvantages of using the ulimit command:
1. You can only modify the file descriptor of the currently logged-on user environment. If this user opens another connection, the file descriptor of this connection environment remains unchanged.
2. if the system is restarted, previous changes will not take effect.
2. Modify the limits. conf file
Edit the/etc/security/limits. conf file and add the following two lines at the end.
* Soft nofile 65536
* Hard nofile 65536
Save and exit. You do not need to restart the server. Log On again and use ulimit-n to see the effect.
In this way, no matter which user is used, no matter whether or not the restart is performed.