Skip to content

Instantly share code, notes, and snippets.

@jaeyson
Created October 7, 2025 04:32
Show Gist options
  • Select an option

  • Save jaeyson/185882680c26f79eb8e15ccb2a6b5279 to your computer and use it in GitHub Desktop.

Select an option

Save jaeyson/185882680c26f79eb8e15ccb2a6b5279 to your computer and use it in GitHub Desktop.
Linux system resource Limits

UNIX/Linux operating systems have the ability to limit the amount of various system resources available to a user process. These limitations include how many files a process can have open, how large of a file the user can create, and how much memory can be used by the different components of the process. The ulimit command can help to discover the current settings.

And to make permanent changes you can edit the /etc/security/limits.conf file, see below. In this example we increase the MariaDB (mysql user) as well as the Nginx (www-data user). This will resolve issues under Linux like "Too many open files", nofile stands for number of open files.

# etc/security/limits.conf
# Increasing the limits (example for mysql and www-data user)
#<domain> <type> <item> <value>
postgres soft nofile 65535
postgres hard nofile 500000
www-data soft nofile 65535
www-data hard nofile 500000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment