How to change Open file limit ( ulimit -n ) on ubuntu 18.04

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.

HOW TO CHANGE OPEN FILE LIMIT ( ULIMIT -N ) ON UBUNTU 18.04 prashantsuthar

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.

Prashant Sutharhttps://prashantsuthar.com
My self Prashant Suthar, I had experience worked with NodeJS, Core PHP, WordPress, CodeIgniter, Shopify, Prestashop, Opencart and many frameworks. I had some basic knowledge about server setup and maintenance. I also worked with third parties APIs like Twillio audio,video, SMS API, FB messenger API and many more. I am working as team lead & sr. developer in Ahmedabad, GJ, IN.

Comments

Similar Articles