How to change Open file limit ( ulimit -n ) on ubuntu 18.04
So, let’s start the article for How to change Open file limit ( ulimit -n ) on ubuntu 18.04
Prerequisites
– Ubuntu 18.04 with SSH access.
Update your package for Ubuntu.
sudo apt-get update sudo nano /etc/sysctl.conf
put this end of file
fs.file-max = 65535
after that change, we need to change in one more file.
sudo nano /etc/security/limits.conf
at end of file add these lines. Please replace UBUNTU with your server username. we are using AWS so by default username UBUNTU.
root soft nproc 65535 root hard nproc 65535 root soft nofile 65535 root hard nofile 65535 ubuntu soft nproc 65535 ubuntu hard nproc 65535 ubuntu soft nofile 65535 ubuntu hard nofile 65535
After saving both files please restart apache2.
For testing/checking please log out from your SSH and log in.
then just check using this command.
ulimit -n
I hope you like this article. Keep visiting my website for more upcoming articles. If you need any help with How to change the Open file limit ( limit -n ) on ubuntu 18.04Â you can contact me. You can ask me questions in the comments also. You can connect me on social media as well as links are below in the footer section. Keep connected. Happy Coding.