Caveats

Things to consider, and exceptions that apply:

  • Even if one can, increasing a resource limit may do more harm than good; think through what you are trying to achieve here. Put yourself in the malicious-hacker mindset (recall (DDoS attacks). On both server class, as well as on highly resource-constrained systems (often an embedded one), setting resource limits appropriately can help mitigate risk.
  • Setting a resource limit to a higher value requires root privilege. For example: we wish to increase the max open files resource limit from 1,024 to 2,000. One would assume that using sudo should do the job. However, at first surprisingly, something such as sudo ulimit -n 2000 will not work! Why? Well, when you run it, sudo expects that ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.