Beaucoup de processus httpd... Normal ?

WRInaute discret
Bonsoir à tous, je dispose d'un site internet, hébergé sur un dédié qui tourne sous linux, mais je m'interroge sur la config de ce dernier ( je ne suis pas celui qui administre le serveur ) ; Il y a constamment une trentaine de processus httpd, ça peut encore monter lorsqu'il y a du monde sur le site...

J'ai aussi dans les ~ 15 mysqld, avec les autres services qui tournent sur la machine, ça me fait tourner dans les ~ 80 / 100 processus tout le temps.

Ne connaissant guère linux, je me demandais si c'était normal... On m'a dit que le problème était lié à la façon dont était codée mon site ( comme si je l'avais codé comme un cochon ! ), mais après avoir réalisé divers tests, je doute fort de cette hypothèse.
 
WRInaute occasionnel
oui cela permets de répondre plus rapidement lorsque il y a peu de visiteurs

c'est une bonne config

l'idée pour optimiser apache est d'avoir des processus prets a répondre.

plus tu aura de visites (en moyenne) plus il faudra monter
 
WRInaute discret
Je poste un ps -aux, ça me semble plus complet :
Code:
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  1688  432 ?        S    May16   0:02 init [3]                    
root         2  0.0  0.0     0    0 ?        SN   May16   0:00 [ksoftirqd/0]
root         3  0.0  0.0     0    0 ?        S<   May16   1:24 [events/0]
root         4  0.0  0.0     0    0 ?        S<   May16   0:00 [khelper]
root         9  0.0  0.0     0    0 ?        S<   May16   0:00 [kthread]
root        18  0.0  0.0     0    0 ?        S<   May16   0:00 [kacpid]
root        84  0.0  0.0     0    0 ?        S<   May16   0:00 [kblockd/0]
root       145  0.0  0.0     0    0 ?        S    May16   0:09 [pdflush]
root       146  0.0  0.0     0    0 ?        S    May16   0:12 [pdflush]
root       148  0.0  0.0     0    0 ?        S<   May16   0:00 [aio/0]
root       147  0.0  0.0     0    0 ?        S    May16   4:24 [kswapd0]
root        92  0.0  0.0     0    0 ?        S    May16   0:00 [khubd]
root       242  0.0  0.0     0    0 ?        S    May16   0:00 [kseriod]
root       426  0.0  0.0     0    0 ?        S    May16   1:06 [kjournald]
root      1267  0.0  0.0  2400  336 ?        S<s  May16   0:00 udevd
root      1969  0.0  0.1  1588  524 ?        Ss   May16   0:02 syslogd -m 0
root      1973  0.0  0.0  1536  440 ?        Ss   May16   0:00 klogd -x
root      2038  0.0  0.1  4052  640 ?        Ss   May16   0:01 rpc.idmapd
root      2191  0.0  0.1  1812  676 ?        S    May16   0:00 /usr/sbin/smartd
root      2201  0.0  0.1 10872  832 ?        S    May16   0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd -a
root      2220  0.0  0.1  2144  700 ?        Ss   May16   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root      2229  0.0  0.1  4448  660 ?        Ss   May16   0:00 crond
root      2238  0.0  0.1  4284  964 ?        S    May16   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var
mysql     2267  0.0  3.6 79276 17988 ?       S    May16   1:42 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
xfs       2276  0.0  0.1  2712  604 ?        Ss   May16   0:00 xfs -droppriv -daemon
root      2285  0.0  0.1  1700  536 ?        Ss   May16   0:00 /usr/sbin/atd
mysql     2294  0.0  3.6 79276 17988 ?       S    May16   2:25 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2295  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2296  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2297  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2298  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
dbus      2299  0.0  0.1  2308  512 ?        Ss   May16   0:00 dbus-daemon-1 --system
mysql     2323  0.0  3.6 79276 17988 ?       S    May16   0:21 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2324  0.0  3.6 79276 17988 ?       S    May16   0:25 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2325  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     2326  0.0  3.6 79276 17988 ?       S    May16   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
root      2335  0.0  0.2  4984 1056 ?        Ss   May16   0:03 hald
root      2367  0.0  0.0  1524  336 tty2     Ss+  May16   0:00 /sbin/mingetty tty2
root      4572  0.0  0.1  3988  832 ?        Ss   May16   0:00 /usr/sbin/sshd
root      4588  0.0  0.0  1524  336 tty1     Ss+  May16   0:00 /sbin/mingetty tty1
root      5023  0.0  0.5 14836 2924 ?        Ss   May16   0:10 /usr/sbin/httpd
mirage    4294  0.3  1.4 35260 7232 ?        D    May22  15:43 ./iroffer homer.conf -b
azora     1826  0.0  0.2  4240 1024 ?        S    May22   2:09 /bin/sh ./start-freya.sh resident
azora     1841  0.0  0.1  3724  948 ?        S    May22   0:05 ./login-server
azora     1853  0.0  0.3  8128 1788 ?        S    May22   1:01 ./char-server
azora     1865  1.7 40.3 260828 201684 ?     S    May22  81:40 ./map-server
mysql     1871  0.0  3.6 79276 17988 ?       S    May22   4:24 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
mysql     1872  0.0  3.6 79276 17988 ?       S    May22   0:05 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
azora    15715  0.0  0.3 15716 1892 ?        S    May23   0:47 php start_sh.php conf/azora.conf.php -b
i-r       5676  0.2  1.3 11316 6504 ?        D    May24   4:51 ./iroffer i-r.conf -b
azora     7706  0.1  1.2 15712 6388 ?        S    May25   0:32 php start_sh.php conf/azora.conf.php -b
apache   24243  0.2  1.2 16728 6116 ?        S    May25   0:12 /usr/sbin/httpd
apache   28195  0.1  1.2 16924 6292 ?        S    May25   0:06 /usr/sbin/httpd
apache   29167  0.2  1.3 16888 6568 ?        S    May25   0:07 /usr/sbin/httpd
apache   31154  0.1  1.1 16500 5880 ?        S    May25   0:05 /usr/sbin/httpd
apache   31579  0.1  1.2 16700 6064 ?        S    May25   0:06 /usr/sbin/httpd
root     32027  0.0  0.4  6992 2204 ?        Ss   May25   0:00 sshd: root@pts/4 
apache   32195  0.1  1.1 16464 5840 ?        S    May25   0:05 /usr/sbin/httpd
root     32198  0.0  0.2  4416 1424 pts/4    Ss   May25   0:00 -bash
nobody    1621  0.0  0.1  2040  748 ?        Ss   May25   0:00 vsftpd
mirage    1654  0.2  0.1  2152  944 ?        S    May25   0:06 vsftpd
apache    3723  0.2  1.1 16456 5764 ?        S    May25   0:04 /usr/sbin/httpd
apache    3728  0.2  1.2 16676 6336 ?        S    May25   0:04 /usr/sbin/httpd
apache    3763  0.1  1.1 16396 5772 ?        S    May25   0:03 /usr/sbin/httpd
apache    4147  0.1  1.2 17148 6416 ?        S    May25   0:03 /usr/sbin/httpd
apache    5636  0.1  1.1 16520 5868 ?        S    May25   0:02 /usr/sbin/httpd
apache    6627  0.1  1.1 16424 5752 ?        S    May25   0:02 /usr/sbin/httpd
apache    8531  0.1  1.1 16480 5780 ?        S    May25   0:01 /usr/sbin/httpd
apache    8533  0.1  1.1 16504 5812 ?        S    May25   0:00 /usr/sbin/httpd
apache    8534  0.2  1.1 16500 5796 ?        S    May25   0:01 /usr/sbin/httpd
apache    8632  0.1  1.1 16388 5684 ?        S    May25   0:01 /usr/sbin/httpd
apache    8775  0.2  1.1 16344 5644 ?        S    May25   0:01 /usr/sbin/httpd
apache    8776  0.2  1.1 16464 5772 ?        S    May25   0:01 /usr/sbin/httpd
apache    8777  0.1  1.1 16452 5760 ?        S    May25   0:00 /usr/sbin/httpd
apache   10486  0.0  0.7 14952 3772 ?        S    00:04   0:00 /usr/sbin/httpd
mysql    10790  2.8  3.6 79276 17988 ?       D    00:05   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
azora    10821  0.0  0.1  3868  532 ?        S    00:05   0:00 sleep 10s
mysql    10823  1.0  3.6 79276 17988 ?       D    00:05   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
root     10826  0.0  0.1  2368  756 pts/4    R+   00:05   0:00 ps -aux

Merci de vous pencher sur la question :D
 
WRInaute discret
Dans le fichier httpd.conf il y a deja un attribut qui permet de specifier le nombre de processus lancés au lancement du demon. Donc c'est normal que tu es plusieurs processus...
Le fait que ca augmente avec le nombre de visiteurs doit certainement etre la methode d'apache permettant de repartir la charge et alors eviter de faire planter le demon.

En tout cas, aucun rapport avec ton code...
 
Discussions similaires
Haut