Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Serveurs (Apache, IIS,...) > Apache
Apache Forum d'entraide Apache. Avant de poster : Cours Apache, FAQ Apache
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 16/12/2010, 11h44   #1
Invité de passage
 
Inscription : février 2008
Messages : 47
Détails du profil
Informations forums :
Inscription : février 2008
Messages : 47
Points : 4
Points : 4
Par défaut Apache utilise 100% du CPU

Bonjour à tous,
J'ai un soucis avec mon serveur dédié : apache utilise la totalité du processeur.
Quand je fais un sudo top voici ce que j'obtiens :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
top - 11:29:39 up 1 day, 22:59,  1 user,  load average: 50.33, 29.81, 16.71
Tasks: 284 total,  71 running, 213 sleeping,   0 stopped,   0 zombie
Cpu(s): 99.8%us,  0.2%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2013264k total,  1389912k used,   623352k free,   162096k buffers
Swap:   526012k total,     2424k used,   523588k free,   568892k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                        
 6434 www-data  20   0  250m 7484 1560 R  1.7  0.4   0:00.71 apache2                                                                        
 6101 www-data  20   0  252m  12m 5160 R  1.5  0.7   0:01.03 apache2                                                                        
 6346 www-data  20   0  252m  11m 4336 R  1.5  0.6   0:00.78 apache2                                                                        
 6360 www-data  20   0  251m 9.8m 3376 R  1.5  0.5   0:00.84 apache2                                                                        
 6363 www-data  20   0  251m 9.8m 3376 R  1.5  0.5   0:00.85 apache2                                                                        
 6364 www-data  20   0  251m 9272 2996 R  1.5  0.5   0:00.85 apache2                                                                        
 6368 www-data  20   0  250m 8236 2180 R  1.5  0.4   0:00.84 apache2                                                                        
 6371 www-data  20   0  250m 8236 2180 R  1.5  0.4   0:00.84 apache2                                                                        
 6372 www-data  20   0  250m 8236 2180 R  1.5  0.4   0:00.84 apache2                                                                        
 6375 www-data  20   0  250m 8236 2180 R  1.5  0.4   0:00.84 apache2                                                                        
 6376 www-data  20   0  250m 8236 2180 R  1.5  0.4   0:00.84 apache2                                                                        
 6378 www-data  20   0  250m 7484 1560 R  1.5  0.4   0:00.84 apache2
etc..
Ma configuration du fichier /etc/apache2/apache2.conf

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
PidFile ${APACHE_PID_FILE}
Timeout 30
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 5

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          180
    MaxRequestsPerChild 100
</IfModule>

<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          180
    MaxRequestsPerChild 100
</IfModule>

<IfModule mpm_event_module>
    StartServers          2
    MaxClients          180
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild  100
</IfModule>

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

DefaultType text/plain
Et dans les logs d'erreur, ça donne ça :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Thu Dec 16 11:28:51 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Thu Dec 16 11:30:20 2010] [warn] child process 6000 still did not exit, sending a SIGTERM
[Thu Dec 16 11:30:20 2010] [warn] child process 6089 still did not exit, sending a SIGTERM
[Thu Dec 16 11:30:20 2010] [warn] child process 6097 still did not exit, sending a SIGTERM
[Thu Dec 16 11:30:20 2010] [warn] child process 6003 still did not exit, sending a SIGTERM
[Thu Dec 16 11:30:20 2010] [warn] child process 6098 still did not exit, sending a SIGTERM
[Thu Dec 16 11:30:20 2010] [warn] child process 6005 still did not exit, sending a SIGTERM
etc...
[Thu Dec 16 11:30:26 2010] [error] child process 6000 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6089 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6097 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6003 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6098 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6005 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6006 still did not exit, sending a SIGKILL
etc...
[Thu Dec 16 11:30:27 2010] [notice] caught SIGTERM, shutting down
[Thu Dec 16 11:30:28 2010] [notice] Apache/2.2.16 (Ubuntu) PHP/5.3.3-1ubuntu9.1 with Suhosin-Patch configured -- resuming normal operations
[Thu Dec 16 11:30:49 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting
Merci d'avance pour votre aide !
numerodix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/12/2010, 11h55   #2
Expert Confirmé Sénior
 
Homme Laurent Willems
Expert Stop/Start
Inscription : septembre 2002
Messages : 2 544
Détails du profil
Informations personnelles :
Nom : Homme Laurent Willems
Âge : 33
Localisation : Belgique

Informations professionnelles :
Activité : Expert Stop/Start

Informations forums :
Inscription : septembre 2002
Messages : 2 544
Points : 4 249
Points : 4 249
Salut,

Quel est le type d'application qui tourne sur ce serveur web?
Code :
1
2
3
4
5
6
7
8
[Thu Dec 16 11:30:26 2010] [error] child process 6098 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6005 still did not exit, sending a SIGKILL
[Thu Dec 16 11:30:26 2010] [error] child process 6006 still did not exit, sending a SIGKILL
etc...
[Thu Dec 16 11:30:27 2010] [notice] caught SIGTERM, shutting down
[Thu Dec 16 11:30:28 2010] [notice] Apache/2.2.16 (Ubuntu) PHP/5.3.3-1ubuntu9.1 with Suhosin-Patch configured -- resuming normal operations
[Thu Dec 16 11:30:49 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting
Tes 180 connexions simultanées sont toutes utilisées As-tu vérifié s'il ne s'agissait pas d'une attaque par déni de service? Peux-également regardé s'il n'y a pas des requêtes suspectes dans les access logs?
__________________
Alea Jacta Test!
Mygale1978 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/12/2010, 12h07   #3
Invité de passage
 
Inscription : février 2008
Messages : 47
Détails du profil
Informations forums :
Inscription : février 2008
Messages : 47
Points : 4
Points : 4
Merci pour cette réponse rapide !
C'est un site web en PHP qui tourne sur le serveur.

Qu'est-ce que tu appelle requêtes suspectes ? Et comment vérifier qu'il ne s'agit pas d'une attaque par déni de service ?

J'ai biens quelques trucs comme ça, je ne sais pas de quoi il s'agit :
Code :
1
2
127.0.0.1 - - [16/Dec/2010:11:28:30 +0100] "OPTIONS * HTTP/1.0" 200 136 "-" "Apache (internal dummy connection)"
Sinon, je remarque qu'il y a toutes les images dans les logs :
XX.XX.XX.XX - - [16/Dec/2010:11:28:29 +0100] "GET /***/img/pic/img.png HTTP/1.1" 304 136 "http://ks******.kimsufi.com/***/index

C'est normal ?
numerodix est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 02h27.


 
 
 
 
Partenaires

Hébergement Web