Apache Prozess limitieren

Apache, Lighttpd, nginx, Cherokee
Post Reply
matthiasm
Posts: 14
Joined: 2002-11-14 18:11
 

Apache Prozess limitieren

Post by matthiasm »

Hallo!

Kann mir jemand sagen, wie man einen bestimmten Prozess (inkl. Sub-Prozesse) limtieren kann (CPU, RAM, ...)? Es geht hierbei um den Apache-Prozess.

Danke.

Matthias.
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: Apache Prozess limitieren

Post by dodolin »

Mit PAM.
kase
Posts: 1031
Joined: 2002-10-14 22:56
 

Re: Apache Prozess limitieren

Post by kase »

bzw beim Apache geht das auch in der httpd Conf. Soviel ich weiß kann man da das max Memory und die Anzahl der Child-Prozesse begrenzen...
matthiasm
Posts: 14
Joined: 2002-11-14 18:11
 

Re: Apache Prozess limitieren

Post by matthiasm »

kase wrote:bzw beim Apache geht das auch in der httpd Conf. Soviel ich weiß kann man da das max Memory und die Anzahl der Child-Prozesse begrenzen...
Ja, aber leider nur die Child-Prozesse, nicht den Hauptprozess.

Matthias.
captaincrunch
Userprojekt
Userprojekt
Posts: 7066
Joined: 2002-10-09 14:30
Location: Dorsten
Contact:
 

Re: Apache Prozess limitieren

Post by captaincrunch »

Quick and dirty per ulimit im Startscript. Sinvoll per PAM ... ;)
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
matthiasm
Posts: 14
Joined: 2002-11-14 18:11
 

Re: Apache Prozess limitieren

Post by matthiasm »

CaptainCrunch wrote:Quick and dirty per ulimit im Startscript. Sinvoll per PAM ... ;)
Hättest Du ein Beispiel wie man "ulimit" in ein Start-Script einbindet, dass habe ich nämlich noch nicht so ganz verstanden. Danke.

Matthias.
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: Apache Prozess limitieren

Post by dodolin »

http://www.de.debian.org/doc/manuals/se ... html#s4.10
If you do not restrict resource usage, any user with a valid shell in your system (or even an intruder who compromised the system through a service) can use up as much CPU, memory, stack, etc. as the system can provide. This resource exhaustion problem can only be fixed by the use of PAM. Note that there is a way to add resource limits to some shells (for example, bash has ulimit, see bash(1)), but since not all of them provide the same limits and since the user can change shells (see chsh(1)) it is better to place the limits on the PAM modules.

Code: Select all

dodo@masterboy:~$ grep www-data /etc/passwd
www-data:x:33:33:www-data:/var/www:/bin/sh
Das ist eine "valid shell". Also ich persönlich würde auf umlimit nicht vertrauen. Genausowenig, wie es Sinn macht, das in der Apachen-Config einzustellen. Das würde voraussetzen, dass Apache gutmütig ist. Ich würde das lieber dem Kernel überlassen und PAM nehmen.
Post Reply