How to Increase Number of Open Files Limit in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Marin Todorov

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

7 Responses

  1. Br.Bill says:

    Does anyone know what “a file” is supposed to be named under /user/lib/sysctl.d/** , as mentioned by Idir?

  2. Roshan says:

    Thanks for the info.

    After making changes in /etc/security/limits.conf and restarting the process, I see open file count in /proc//limits is not changed!!! What else needs to be changed to get the changes reflected here..?

  3. Pushkar Sawant says:

    What should be the open file limit if the system RAM is 8GB? Also would like to know how to calculate this?
    we are having Ubuntu 12.04 with 8GB of RAM. I be leave we need to consider system RAM before changing he limit.

  4. nag says:

    Thanks for sharing information nice.

  5. Jalal Hajigholamali says:


    Thanks for very nice & useful article

  6. Marin Todorov says:


    You are correct, but still I would like to clarify that per systemctl’s manual the following files are read:

    Load settings from all system configuration files.

    So practically /etc/sysctl.conf is still read.

  7. Idir says:

    This way of increasing the open files limit is not reliable anymore, you need to create or edit a file in /usr/lib/sysctl.d/**.

    Although if you need to optimize a web-server, you are probably going to need to edit :

     kernel.pid_max = 65536
     net.core.netdev_max_backlog = 8192
     net.ipv4.tcp_syncookies = 0
     net.core.somaxconn = 8192
     net.ipv4.tcp_max_syn_backlog = 8192 
     net.ipv4.ip_local_port_range  = 1024 65535
     net.ipv4.tcp_tw_recycle = 1
     net.ipv4.tcp_tw_reuse = 1

Leave a Reply to nag Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.