Apache2 überflutet CPU

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
Technikboy04
Beiträge: 7
Registriert: 09.07.2016 16:19:25

Apache2 überflutet CPU

Beitrag von Technikboy04 » 09.07.2016 16:25:20

Halli liebe Debian Community,

ich habe aktuell ein sehr seltsames Problem. Vor gut einer Woche ist mir aufgefallen, das meine Homepage(Auf wordpress basis) sehr langsam arbeitet. Nun habe ich heute einmal nach der Auslastung meines V-Servers geschaut.

Der Top Befehl nach einem Kompletten Server Reboot ohne gestarteten apache2

top - 16:22:04 up 9 min, 1 user, load average: 0.22, 2.23, 1.45
Tasks: 94 total, 1 running, 93 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.2 us, 0.3 sy, 0.0 ni, 99.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 14402120 total, 485664 used, 13916456 free, 119296 buffers
KiB Swap: 0 total, 0 used, 0 free. 162180 cached Mem

Mit apache2

top - 16:23:06 up 10 min, 1 user, load average: 10.23, 4.23, 2.16
Tasks: 238 total, 13 running, 224 sleeping, 0 stopped, 1 zombie
%Cpu(s): 84.8 us, 4.9 sy, 0.0 ni, 7.9 id, 1.9 wa, 0.0 hi, 0.4 si, 0.1 st
KiB Mem: 14402120 total, 2201404 used, 12200716 free, 133716 buffers
KiB Swap: 0 total, 0 used, 0 free. 194908 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3352 www-data 20 0 504856 62468 43288 S 12.3 0.4 0:00.88 apache2
3088 www-data 20 0 504856 62456 43276 S 10.6 0.4 0:01.12 apache2
3053 www-data 20 0 503320 60880 43276 R 10.3 0.4 0:00.75 apache2
3200 www-data 20 0 503580 61004 43264 R 10.0 0.4 0:00.63 apache2
3280 www-data 20 0 504856 62440 43264 S 10.0 0.4 0:00.46 apache2
2965 www-data 20 0 504856 62456 43276 S 9.0 0.4 0:01.38 apache2
3054 www-data 20 0 502552 59864 43276 R 8.3 0.4 0:00.60 apache2
3108 www-data 20 0 495896 54312 43264 S 8.3 0.4 0:00.58 apache2
2974 www-data 20 0 502552 59868 43276 R 8.0 0.4 0:01.00 apache2
3085 www-data 20 0 505016 64148 44416 S 8.0 0.4 0:01.10 apache2
3274 www-data 20 0 505016 64128 44404 S 8.0 0.4 0:00.40 apache2
3265 www-data 20 0 501276 58700 43264 R 7.3 0.4 0:00.42 apache2
3329 www-data 20 0 503784 62812 44808 R 7.3 0.4 0:00.61 apache2
3135 www-data 20 0 500248 58664 43264 S 7.0 0.4 0:00.56 apache2
3007 www-data 20 0 505324 64956 44800 S 6.6 0.5 0:00.62 apache2
3012 www-data 20 0 498972 57400 43276 S 6.6 0.4 0:00.55 apache2
3101 www-data 20 0 504860 62460 43276 S 6.6 0.4 0:00.70 apache2
3194 www-data 20 0 504856 62444 43264 S 6.6 0.4 0:00.73 apache2
3245 www-data 20 0 498972 57384 43264 S 6.6 0.4 0:00.39 apache2
2964 www-data 20 0 504856 62456 43276 S 6.3 0.4 0:00.96 apache2
3035 www-data 20 0 495896 54328 43276 S 6.3 0.4 0:01.06 apache2
3051 www-data 20 0 497176 55600 43276 S 6.3 0.4 0:00.37 apache2
3157 www-data 20 0 504856 62436 43264 S 6.3 0.4 0:00.38 apache2
3062 www-data 20 0 504856 62456 43276 S 6.0 0.4 0:01.02 apache2
3100 www-data 20 0 495896 54324 43276 S 6.0 0.4 0:00.53 apache2
3056 www-data 20 0 504864 62464 43276 S 5.6 0.4 0:00.65 apache2
3145 www-data 20 0 504856 62440 43264 S 5.6 0.4 0:00.50 apache2
3182 www-data 20 0 504856 62444 43264 S 5.6 0.4 0:01.05 apache2
3064 www-data 20 0 505112 62964 43276 S 5.3 0.4 0:00.68 apache2
3078 www-data 20 0 495896 54324 43276 S 5.3 0.4 0:00.52 apache2
3086 www-data 20 0 497176 55604 43276 S 5.3 0.4 0:00.52 apache2
3156 www-data 20 0 504856 62444 43264 S 5.3 0.4 0:00.64 apache2
3159 www-data 20 0 504856 62440 43264 S 5.3 0.4 0:00.50 apache2
3294 www-data 20 0 504856 62468 43288 S 5.3 0.4 0:00.69 apache2
2955 www-data 20 0 504856 62452 43276 S 5.0 0.4 0:00.47 apache2
2986 www-data 20 0 505112 62964 43276 S 5.0 0.4 0:00.98 apache2
3057 www-data 20 0 505340 64992 44800 S 5.0 0.5 0:00.83 apache2
3063 www-data 20 0 505112 62964 43276 S 5.0 0.4 0:00.64 apache2
3074 www-data 20 0 498972 57400 43276 S 5.0 0.4 0:00.51 apache2
3105 www-data 20 0 504856 62456 43276 S 5.0 0.4 0:00.63 apache2
3173 www-data 20 0 504856 62440 43264 S 5.0 0.4 0:00.48 apache2
3231 www-data 20 0 497176 55588 43264 S 5.0 0.4 0:00.34 apache2
584 teamspe+ 20 0 1389680 23156 9072 S 4.7 0.2 0:22.09 ts3server_linux
2972 www-data 20 0 504860 62460 43276 S 4.7 0.4 0:00.86 apache2
3028 www-data 20 0 503320 60732 43256 R 4.7 0.4 0:01.21 apache2
3090 www-data 20 0 504860 62456 43276 S 4.7 0.4 0:00.56 apache2
3152 www-data 20 0 497176 55596 43264 S 4.7 0.4 0:00.64 apache2
3271 www-data 20 0 504856 62436 43264 S 4.7 0.4 0:00.32 apache2
3008 www-data 20 0 504856 62456 43276 S 4.3 0.4 0:00.72 apache2
3097 www-data 20 0 504856 62456 43276 S 4.3 0.4 0:01.07 apache2
3199 www-data 20 0 505324 65104 44788 S 4.3 0.5 0:00.81 apache2
3269 www-data 20 0 504856 62444 43264 S 4.3 0.4 0:00.85 apache2
3277 www-data 20 0 503320 60944 43264 R 4.0 0.4 0:00.28 apache2
3345 www-data 20 0 502808 60172 43288 R 3.7 0.4 0:00.27 apache2
3235 www-data 20 0 501272 58800 43264 R 3.3 0.4 0:00.75 apache2
3349 www-data 20 0 502552 60236 43288 R 3.0 0.4 0:00.72 apache2

jetzt stelle ich mir die Frage, wo diese ganzen Prozesse herkommen. Ich kann es mir nicht erklären. Die CPU auslastung spricht ja wohl für sich, dass hier etwas nicht normal ist. Könnt ihr mir vielleicht weiter helfen?

SERVER:

4 Kern V Server
14 Gb RAM
1TB HDD
100 mb/s

MfG. Jan Sniehota

DeletedUserReAsG

Re: Apache2 überflutet CPU

Beitrag von DeletedUserReAsG » 09.07.2016 16:36:57

Im Normalfall startet der Apache nicht von sich aus viele neue Threads/Prozesse (es sei denn, jemand hat in der Config etwas anderes angegeben), sondern nur im Bedarfsfall. Mal mit lsof schauen, wieviele Clients da gerade bedient werden? Ein Blick in die Logs hilft auch erstaunlich oft, Ursachen für Probleme zu finden.

Technikboy04
Beiträge: 7
Registriert: 09.07.2016 16:19:25

Re: Apache2 überflutet CPU

Beitrag von Technikboy04 » 09.07.2016 16:44:22

Bei lsof werden über 100 clients angezeigt

Technikboy04
Beiträge: 7
Registriert: 09.07.2016 16:19:25

Re: Apache2 überflutet CPU

Beitrag von Technikboy04 » 09.07.2016 16:58:36

Es war unsere Wordpress Seite welche das Problem ausgelöst hat. Hab es durch einen Eintrag von einem Plugin in den apache2 logs herausgefunden!

Antworten