- Check the current global limitatoins
ulimit -a
2. Find the pid of target process
ps -ef|grep allproxy
3.0 View the amount of files of process:
ls /proc/926/fd | wc -l
3. View the open files of target proces
3. Change open files value
ulimit -n 20480
4. restart process
5. The above method only works for current sytem, it will missing when restart the server, so we have to change system files
vim /etc/security/limits.conf
add the following content in the end:
* soft nofile 20480
* hard nofile 20480
root soft nproc 204800
root hard nproc 204800
- Change /etc/supervisor/supervisord.conf, add “minfds=XXX” under
[supervisord]
- Restart supervisor
Global Configuration
Temporarily Increase Global File Descriptor Limit (total number of file descriptors that can be created by all processes)
- View global file descriptor limit: cat /proc/sys/fs/file-max
- Configure: :echo 1000000 > /proc/sys/fs/file-max
- Takes effect immediately after configuration
Permanently Increase Global File Descriptor Limit
- Edit configuration file /etc/sysctl.conf, add the following line at the end: fs.file-max=1000000
- Make the configuration file take effect: sysctl -p
Special Note:
- The per-process file descriptor limit must not exceed the global file descriptor limit!!! I encountered a situation where I carelessly set the per-process limit higher than the global limit, which led to being unable to boot up and login afterwards!!!