If errors occur in the Mobility Suite Email Proxy's "/usr/local/nginx/logs/error.log" file that mention "accept4() failed (24: Too many open files)", then the following steps can be followed to resolve this issue:
Change the configurations
1. Type the below command and all those that follow from the Linux Terminal on the Email Proxy as the "root" user:
vi /etc/sysctl.conf
2. Scroll through and search for the line "fs.file-max" or add it to just before the "# End Of File" if it does not exist and press "i" to change the value from its current limit to "fs.file-max = 99999".
3. Hit the "Esc" key and type ":wq" to save and quit out of the file.
4. Type the following command:
vi /etc/security/limits.conf
5. Using "i" edit an existing limit or make a new limit for the "symc-proxy" user (The user that was created during secure proxy installation) to resemble the below example:
symc-proxy soft nofile 25000
symc-proxy hard nofile 50000
6. Hit the "Esc" key and type ":wq" to save and quit out of the file.
7. Type the below command to reload the changes that were made to the "sysctl.conf" file and ensure the "fs.file-max" entry was properly saved:
sysctl -p
8. Type the below command:
vi /usr/local/nginx/conf/nginx.conf
9. Scroll through and search for the line "worker_rlimit_nofile" and press "i" to change the current value to "worker_rlimit_nofile 50000;"
10. Hit the "Esc" key and type ":wq" to save and quit out of the file.
11. Type the following command to restart the "nginx" service:
service nginx restart
The "Too many open files" error should be resolved upon completion of the above steps.
Check the configuration changes
Once the above steps have been completed, the output of the commands outlined in steps "6" and "7" listed below as the "symc-proxy" user will show if the limits have been changed successfully:
1. Navigate to the "/home/" directory:
cd /home/
2. Create a directory for the "symc-proxy" user (The user that was created during secure proxy installation):
mkdir symc-proxy
3. Change the ownership of the "symc-proxy" directory to the "symc-proxy" user and its group:
chown symc-proxy:symc-proxy symc-proxy
4. Change the bash shell to the "symc-proxy" user (It is alright if the output is "Shell not changed"):
chsh -s /bin/bash symc-proxy
5. Change to the "symc-proxy" user:
su - symc-proxy
6. Check the user's hard resource limit:
ulimit -Hn
7. Check the user's soft resrouce limit:
ulimit -Sn
If the output shown in steps 6 and 7 match what was configured in the initial step 5, then the modifications were a success and the "Too many open files" error should no longer persist.
Optional
In order to return back to the "root" user the following command can be run:
exit