How to Increase Number of Open Files Limit in Linux

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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

4 Responses

  1. nag says:

    Thanks for sharing information nice.

  2. Jalal Hajigholamali says:

    Hi,

    Thanks for very nice & useful article

  3. Marin Todorov says:

    Hi,

    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.
    /run/sysctl.d/*.conf
    /etc/sysctl.d/*.conf
    /usr/local/lib/sysctl.d/*.conf
    /usr/lib/sysctl.d/*.conf
    /lib/sysctl.d/*.conf
    /etc/sysctl.conf

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

  4. 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
    

Got something to say? Join the discussion.

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

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's