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.
Apache Prozess limitieren
Re: Apache Prozess limitieren
Mit PAM.
Re: Apache Prozess limitieren
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
Ja, aber leider nur die Child-Prozesse, nicht den Hauptprozess.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...
Matthias.
-
captaincrunch
- Userprojekt

- Posts: 7066
- Joined: 2002-10-09 14:30
- Location: Dorsten
- Contact:
Re: Apache Prozess limitieren
Quick and dirty per ulimit im Startscript. Sinvoll per PAM ... ;)
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Re: Apache Prozess limitieren
Hättest Du ein Beispiel wie man "ulimit" in ein Start-Script einbindet, dass habe ich nämlich noch nicht so ganz verstanden. Danke.CaptainCrunch wrote:Quick and dirty per ulimit im Startscript. Sinvoll per PAM ... ;)
Matthias.
Re: Apache Prozess limitieren
http://www.de.debian.org/doc/manuals/se ... html#s4.10
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.
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