IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Apache Discussion :

Apache utilise 100% du CPU


Sujet :

Apache

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Février 2008
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 47
    Points : 25
    Points
    25
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 !

  2. #2
    Invité
    Invité(e)
    Par défaut
    Salut,

    Quel est le type d'application qui tourne sur ce serveur web?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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?

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Février 2008
    Messages
    47
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 47
    Points : 25
    Points
    25
    Par défaut
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 ?

Discussions similaires

  1. Réponses: 1
    Dernier message: 02/04/2013, 13h49
  2. Apache : 50 à 100% d'utilisation CPU
    Par newty dans le forum Apache
    Réponses: 2
    Dernier message: 10/03/2011, 18h07
  3. Eclipse CDT Completion: Utilisation 100% CPU
    Par XeN-Lo dans le forum Eclipse C & C++
    Réponses: 6
    Dernier message: 04/03/2008, 18h00
  4. [Apache] utiliser MySQL
    Par sebduth dans le forum Apache
    Réponses: 3
    Dernier message: 04/08/2004, 11h17

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo