Related
Quick Links
No Limits!
We may all like no limits, but is it really such a good idea?
Usually, when there are no limits, ‘there’ll be dragons’.
It is the same with limits.conf, though for testing servers, a truly unlimited limits.conf helps!
What Islimits.conf?
Thelimits.conffile contains resource limit tweaks for the Linux operating system.
These values are set to pre-specified limits to ensure that your Linux system will not easily overload.
Otherwise, a rogue program or process could easily bring an otherwise performant system to a halt.
Soon the system will run out of a resource it needs to handle all these open files.
The format of thelimits.conffile (which resides in
) is well defined.
and finally a value (the actual setting/maximum).
Going Unlimited
In general, for all intents and purposes, one should never go unlimited withlimits.conf.
Then, you may ask, why this article?
Well, whenever there is a rule, there is a valid exception.
The exception, in this case, is for testing servers.
For all other servers, as indicated, a per-server configuration is preferred and recommended.
Without further ado, let us introduce a script which sets all variables and options inlimits.confto unlimited.
This script is based on the GPLv2 licensedsetup_server.shscript in the mariadb-qa repository on GitHub.
TLDR; Proceeding to implement this is at your own risk.
Note how all of the options are unlimited exceptnofilefor which 1048576 is the maximum.
Wrapping up
There are valid use cases for setting/etc/security/limits.confto every possible maximum.
They are generally rare (with testing servers being a notable exception).
In this article, we learned .conf: why it exists, and how to change its configuration.