a small script that checks the current files used by Nginx and Apache2 processes and compares them with the current soft limits assigned to each process. If the number of open files exceeds the defined threshold (80% by default), it will display the count in red.
curl -fsSLm10 https://7j.gg/chknof | sudo bash -s
Example output:
❯ curl -fsSLm10 https://7j.gg/chknof | sudo bash -s --
Checking services nginx apache2
The open files limit threshold has been set at 80%
Process 1936 :: /usr/sbin/apache2 -k start
Current open files: 85
Limit for open files: 8192
Process 21887 :: /usr/sbin/apache2 -k start
Current open files: 84
Limit for open files: 8192
Process 21890 :: /usr/sbin/apache2 -k start
Current open files: 92
Limit for open files: 8192
Process 21892 :: /usr/sbin/apache2 -k start
Current open files: 92
Limit for open files: 8192
Process 1840 :: nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
Current open files: 53
Limit for open files: 1024
Process 22082 :: nginx: worker process
Current open files: 56
Limit for open files: 65535
Process 22083 :: nginx: worker process
Current open files: 56
Limit for open files: 65535
Process 22084 :: nginx: worker process
Current open files: 56
Limit for open files: 65535
Process 22085 :: nginx: cache manager process
Current open files: 53
Limit for open files: 65535