PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache rennt Amok!



Elegua
09.01.04, 18:39
Hi! :)

Mein Apache hat einmal nur 5 Prozesse und dann kommen auf einmal 100 Prozesse gleichzeitig:

root 23183 0.0 1.2 79512 6520 ? S Jan06 0:06 /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17165 0.1 1.6 80552 8276 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17166 0.0 1.6 80440 8164 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17167 0.1 1.7 80852 8696 ? S 19:18 0:01 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17168 0.1 1.6 80608 8376 ? S 19:18 0:01 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17169 0.0 1.4 79668 7288 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17170 0.0 1.4 79732 7304 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17172 0.1 1.9 82256 10048 ? S 19:18 0:01 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17173 0.1 1.6 80700 8516 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17174 0.1 1.9 82256 10044 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17175 0.0 1.4 79672 7168 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17176 0.1 1.6 80628 8400 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17177 0.0 1.6 80496 8228 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17178 0.0 1.6 80552 8376 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17179 0.0 1.4 79676 7176 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17180 0.0 1.4 79684 7292 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17181 0.1 1.9 82144 9916 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17182 0.0 1.4 79672 7292 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17183 0.0 1.5 80048 7704 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17184 0.1 1.7 81208 9052 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17185 0.0 1.6 80772 8544 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17188 0.0 1.7 80956 8644 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17189 0.0 1.4 79668 7176 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17190 0.0 1.6 80736 8508 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17191 0.1 1.9 82208 10096 ? S 19:18 0:01 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17192 0.0 1.4 79668 7176 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17195 0.0 1.4 79680 7180 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17196 0.0 1.6 80768 8528 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17201 0.0 1.4 79676 7180 ? S 19:18 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17288 0.0 1.4 79668 7152 ? S 19:21 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17339 0.0 1.6 80784 8544 ? S 19:24 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17344 0.0 1.3 79628 7072 ? S 19:24 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17470 0.0 1.4 79636 7120 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17471 0.0 1.4 79732 7324 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17472 0.0 1.3 79628 7024 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17473 0.0 1.4 79664 7164 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17474 0.0 1.4 79672 7144 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17475 0.0 1.3 79632 7072 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17479 0.0 1.4 79624 7168 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17483 0.0 1.4 79660 7260 ? S 19:27 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17537 0.0 1.4 79636 7120 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17538 0.0 1.3 79544 6892 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17539 0.1 1.4 79688 7160 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17540 0.0 1.4 79672 7132 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17541 0.0 1.4 79688 7156 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17542 0.0 1.4 79632 7100 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17543 0.7 1.7 81088 8848 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17546 0.0 1.3 79568 7056 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17551 0.0 1.3 79628 6996 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17555 0.3 1.6 80764 8476 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17556 0.0 1.3 79512 6620 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17558 0.0 1.3 79548 6932 ? S 19:29 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17623 0.0 1.3 79512 6620 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17624 0.0 1.3 79512 6620 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17625 0.0 1.3 79512 6620 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17626 0.0 1.3 79628 6996 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17627 0.0 1.2 79512 6556 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17628 1.0 1.2 79512 6556 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd
wwwrun 17630 0.0 1.2 79512 6556 ? S 19:30 0:00 \_ /wwwrun/apache_1.3.28/bin/httpd

Hat jemand einen Tipp wie ich dem auf die Schliche kommen kann?

Ich habe mehrere v-Hosts und kann auch in den error und accesslogs nichts verdächtiges finden.

Hier auch ein Ausschnitt aus der httpd.conf:

ServerType standalone
ServerRoot "/wwwrun/apache_1.3.28"
PidFile /wwwrun/apache_1.3.28/logs/httpd.pid
ScoreBoardFile /wwwrun/apache_1.3.28/logs/httpd.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0

btw:
Wie kann ich das eigentlich unterbinden das 1 Host 1000 Anfragen an meinen Apache senden kann?
Kann ich das pro Client nicht irgendwie begrenzen?

Hat jemand einen Tip für mich?

Viele Grüße,
Paddy.

Pingu
09.01.04, 19:16
Original geschrieben von paddyhm

Mein Apache hat einmal nur 5 Prozesse und dann kommen auf einmal 100 Prozesse gleichzeitig:
...
Hat jemand einen Tipp wie ich dem auf die Schliche kommen kann?


Die Antwort steht in Deiner httpd.conf:


Original geschrieben von paddyhm

ServerType standalone
ServerRoot "/wwwrun/apache_1.3.28"
PidFile /wwwrun/apache_1.3.28/logs/httpd.pid
ScoreBoardFile /wwwrun/apache_1.3.28/logs/httpd.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0


Original geschrieben von paddyhm
Wie kann ich das eigentlich unterbinden das 1 Host 1000 Anfragen an meinen Apache senden kann?
Kann ich das pro Client nicht irgendwie begrenzen?
AFAIK, gar nicht, weil die Requests stellt ja der Web-Client und der ist dafür verantwortlich.

Pingu

netzmeister
09.01.04, 19:51
Hallo paddyhm,

ein paar hundert Prozesse sind nichts Schlimmes. Nur sollte Deine Hardware
dazu passend ausgelegt sein. ;)

Die vielen Prozesse kommen vom Zusammenspiel von Apache, PHP und Mysql.
Die drei dazu gehörigen Konfigurationsdateien sind Deine Freunde. Die müssen
entsprechend Deiner Bedürfnisse angepasst werden.

Insbesondere bei Anwendungen die Ressourcen gerne binden, wie z.B.
phpAdsNew oder vielen Script Anwendungen die auch auch Datenbanken
zugreifen, ist eine genaue Kenntnis der Umgebung für einen sicheren
und performanten Betrieb notwending.

Versuche es mal hiermit: bei 1 GB RAM und vielen lausig geschriebenen Scripten :D


#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#

#
KeepAlive On

#

#
MaxKeepAliveRequests 0

#

#
KeepAliveTimeout 15

#

#
MinSpareServers 5
MaxSpareServers 20

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 5

#

#
MaxClients 300

#

#
MaxRequestsPerChild 300000


Ich kann da ein Lied von singen.

Viele Grüße

Eicke

Elegua
11.01.04, 13:44
Hallo Ihr alle!
;)

Ja, ich habe nun das Modul mod_status aktiviert und ExtendedStatus auf On gestellt.

Es erscheint eine detailierte Ausgabe über alle Prozesse und man kann sehrschön sehen,
was welcher Prozess, mit wieviel CPU-Power und mit welchem Dokument macht. :)

U.a. auch RTFM:
http://httpd.apache.org/docs/misc/perf-tuning.html

Vielen Dank!