Page 1 of 1
Apache Prozess limitieren
Posted: 2003-06-02 18:40
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.
Re: Apache Prozess limitieren
Posted: 2003-06-02 18:42
by dodolin
Mit PAM.
Re: Apache Prozess limitieren
Posted: 2003-06-02 20:05
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...
Re: Apache Prozess limitieren
Posted: 2003-06-02 20:13
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.
Re: Apache Prozess limitieren
Posted: 2003-06-02 20:59
by captaincrunch
Quick and dirty per ulimit im Startscript. Sinvoll per PAM ... ;)
Re: Apache Prozess limitieren
Posted: 2003-06-02 22:16
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.
Re: Apache Prozess limitieren
Posted: 2003-06-03 00:10
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.