Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We tried /etc/security/limits.conf, but that seems to have no effect.

The used line for limits.conf looks as follows:

myuser hard nproc 6

That is configuration for a server. I want to limit the processes started. Ulimit limits the processes started from the shell (if I understand that right). But in my case apache starts mapserver-processes, and that number have to be limited.

share|improve this question
What's the exact line you have in limits.conf? Update the question with it if you could. – Ken Simon Dec 8 '10 at 14:50
There is a similar question on serverfault: how to limit the number of simultaneous processes ? – Lekensteyn Dec 8 '10 at 14:53
Logout all instances of myuser before testing,as the limits are set upon login.Also see this – karthick87 Dec 8 '10 at 15:35
/etc/security/limits.conf is a configuration file for PAM's pam_limits module, but Apache isn't spawning processes through PAM, so it will have no effect. – Kees Cook Dec 8 '10 at 21:32

This is not the ideal solution because it can interfere with apache upgrades, but it should work.

Edit /etc/init.d/apache2, on the top of the script (new line after the #!/bin/sh) add the required ulimit, example:

ulimit -u 1024
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.