Understanding pam_limits and ulimit
Before the cgroup and systemd technologies were invented, we had other methods for controlling resource usage. These methods are still with us, and we can do some things with them that we can't do with cgroups. To demonstrate, let's briefly look at two of these older methods.
The ulimit command
The ulimit
command allows us to dynamically control resource usage for a shell session and for any processes that get started by the shell session. Let's use the -a
option to see what the default settings are for my current shell session:
As you can see, doing ulimit -a
also shows us the option switches that we'd use to set the various limits. The trick is that you can either set or lower limits as a normal user, but you need sudo
privileges to increase any limits. For example, let's say that we want to limit the size of any new files to only ten...