Bonjour,

Voici mon/mes problème(s) :
Depuis mon passage sur un serveur dédié bi-xéon 4Go RAM, il n'y a plus qu'un seul processus mysql qui tourne et celui-ci grimpe souvent à 99,9%CPU.

Premier soucis, il ne devrait pas grimper si haut et je ne trouve pas la raison. Les requêtes sont optimisées, les index bien placés, aucune requête lente. (mon site a 4 ans et je n'ai cessé de l'optimiser avec l'augmentation du traffic)

Deuxième soucis, il y a deux processeurs, donc il devrait théoriquement être capable de dépasser les 100%CPU (à 99,9% il n'utilise que 50% de chaque). Qu'est-ce qui le bloque ?

Voici ma configuration :
mysql 4.0.24
apache 1.3.33
php 4.3.10-19

(oui c'est un peu vieux)

Fichier my.cnf
max_connections=700

key_buffer = 768M
max_allowed_packet = 16M
thread_stack = 128K
tmp_table_size = 128M
thread_cache_size = 90
max_heap_table_size = 128M
max_tmp_tables = 64
sort_buffer_size = 6M
myisam_sort_buffer_size = 64M
read_rnd_buffer_size = 2M
join_buffer_size = 5M
read_buffer_size = 2M
long_query_time = 2
thread_concurrency = 4

query_cache_limit = 2M
query_cache_size = 100M #16777216
query_cache_type = 1
table_cache = 2048
max_connections élevé car j'ai testé les connexions permanentes mais cela n'a rien changé au niveau de la charge CPU de mysql.

Mon site accueille aux heures de pointes 700 personnes en même temps, et il s'en trouve légèrement ralenti.
Précision : le serveur ne swappe jamais

Petit top :
Tasks: 253 total, 1 running, 252 sleeping, 0 stopped, 0 zombie
Cpu(s): 52.0% us, 12.6% sy, 0.0% ni, 28.7% id, 6.1% wa, 0.2% hi, 0.3% si
Mem: 4149272k total, 2747316k used, 1401956k free, 130212k buffers
Swap: 522104k total, 0k used, 522104k free, 1639324k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1907 mysql 18 0 999m 507m 3044 S 99.9 12.5 1947:55 mysqld
30592 www-data 20 0 16480 6432 3940 S 1.0 0.2 0:04.81 apache
16549 www-data 15 0 17304 6276 3044 S 1.0 0.2 0:00.62 apache
7518 www-data 15 0 16692 6516 3900 S 0.7 0.2 0:03.46 apache
16264 www-data 15 0 16504 5636 3120 S 0.7 0.1 0:00.91 apache
28401 www-data 15 0 16496 6424 3916 S 0.3 0.2 0:05.43 apache
30591 www-data 15 0 16436 6408 3960 S 0.3 0.2 0:04.64 apache
30600 www-data 15 0 17124 6440 3300 S 0.3 0.2 0:04.66 apache
3236 www-data 15 0 16760 5924 3152 S 0.3 0.1 0:04.02 apache
3399 www-data 15 0 16500 6412 3900 S 0.3 0.2 0:03.66 apache
5421 www-data 15 0 16476 5668 3188 S 0.3 0.1 0:03.31 apache
5461 www-data 15 0 16632 6580 3936 S 0.3 0.2 0:03.60 apache
5466 www-data 15 0 16756 6696 3928 S 0.3 0.2 0:03.31 apache
6859 www-data 15 0 16632 6480 3868 S 0.3 0.2 0:03.19 apache
6921 www-data 15 0 16900 5960 3160 S 0.3 0.1 0:04.02 apache
8055 www-data 15 0 16684 6484 3852 S 0.3 0.2 0:02.62 apache
8097 www-data 15 0 16484 6436 3940 S 0.3 0.2 0:02.99 apache
8103 www-data 15 0 16672 6588 3908 S 0.3 0.2 0:03.94 apache
9633 www-data 15 0 16748 6656 3896 S 0.3 0.2 0:02.69 apache
12136 www-data 18 0 16528 5676 3136 S 0.3 0.1 0:02.15 apache
16508 www-data 15 0 16492 5636 3136 S 0.3 0.1 0:01.07 apache
18389 www-data 15 0 16720 5604 2904 S 0.3 0.1 0:00.17 apache
18477 www-data 15 0 16700 5336 2772 S 0.3 0.1 0:00.13 apache
Merci de votre aide.