Aller au contenu

surveillance administration


genmin

Sujets conseillés

Bonjour, je suis encore pas très familiarisé avec l'administration serveur et je me demandai comment surveiller que tout fonctionne bien. Je m'explique, j'ai un serveur dédié qui me pose des souci, celui-ci se met a ralentir jusqu'à ne plus répondre du tout. Je pense que mon problème vient d'une mauvaise configuration d'apache et mysql. mais je ne dispose que de la commande 'top' pour visualiser l'etat du serveur, information que j'ai du mal à déchiffrer d'ailleurs. Que signifie dans la ligne CPU les différents termes %us, %sy, %ni, %id, %wa, %hi, %si, %st

CODE
top - 17:44:50 up 5 days, 3:16, 1 user, load average: 11.41, 4.01, 1.78

Tasks: 148 total, 3 running, 145 sleeping, 0 stopped, 0 zombie

Cpu(s): 58.1%us, 41.4%sy, 0.0%ni, 0.2%id, 0.2%wa, 0.0%hi, 0.2%si, 0.0%st

Mem: 2067772k total, 1176372k used, 891400k free, 85352k buffers

Swap: 1951888k total, 6760k used, 1945128k free, 833712k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

15456 mysql 15 0 138m 43m 5360 S 194 2.2 16:31.30 mysqld

17906 www-data 20 0 26212 9888 4028 S 4 0.5 0:00.19 apache2

17944 www-data 16 0 24320 8304 4112 S 0 0.4 0:00.42 apache2

17955 michelec 15 0 9712 3280 2180 S 0 0.2 0:00.16 proftpd

Comment mysql peut utilise 194 % du CPU ????

Si vous avez une méthode pour trouver la bonne configuration apache et mysql je suis preneur. Et comment voir le nombre de connexion simultané au serveur ?

je suis vraiment aveugle pour le moment, merci de m'indiquer la lumière :P

Lien vers le commentaire
Partager sur d’autres sites

Merci pour l'information, mais ce poste parle surtout de comment réaliser un backup de la base, pour ça j'ai réalisé un script qui me le fait et ca fonctionne bien (enfin quelque chose qui marche :rolleyes: ).

Merci quand même.

Lien vers le commentaire
Partager sur d’autres sites

non l'heure indiqué du poste de Dan, parle de réparer les tables qui prennent beaucoup de mémoire et ou processus

sinon l'autre jour j'avais ce soucis, et toujours d'après un post de Dan (un dieu Linux lui) j'ai vider mes logs du server et j'ai redémarré apache et hop tout été correct

piste à explorer donc (oublie pas de les sauvegarder avant au cas ou)

Modifié par TrocWeb
Lien vers le commentaire
Partager sur d’autres sites

Hello,

pour du ponctuel MySQL, le plus "simple" est de se connecter au serveur MySQL et de lancer un "show processlist".

Mais pour un suivi en temps réel, "mytop" est plus pratique. Il en existe pas mal d'autres du genre.

Sinon sur WMC (désolé) il y a un petit topic dédié à l'administration de MySQL.

Mais un monitoring permanent de la machine ainsi que de ses services sera toujours utile (Munin, Nagios, Cacti, etc).

Que signifie dans la ligne CPU les différents termes %us, %sy, %ni, %id, %wa, %hi, %si, %st

Dans les grandes lignes :

%us "user" : pourcentage d'occupation en zone "utilisateurs" (la plupart des applications)

%sy "system" : pourcentage d'occupation en zone "système" (grosso modo le kernel)

%ni "nice" : comme le "user" mais uniquement pour les programmes dont la priorité a été modifiée via "nice".

%id "idle" : pourcentage de glandouille

%wa "wait IO" : pourcentage d'occupation en attente d'entrées/sorties (typiquement les accès disque)

%hi / %si / %st : aucune idée dsl.

Mais en faisant un man top tu obtiendras certainement les définitions exactes.

Comment mysql peut utilise 194 % du CPU ????

Bah... tu as combien de processeur ? ;)

Eventuellement, fais un cat /proc/cpuinfo pour voir le nombre de processeur considérés par le noyau (avec l'hyperthreading des Pentium 4 le nombre peut-être doublé).

Là comme ça en tous cas ton MySQL semble bouffer tout le CPU, tu n'as à priori aucun soucis d'accès disque et plein de mémoire libre ou pas vraiment utilisée. Je peux me tromper mais oui ton serveur MySQL a l'air assez mal configuré.

Mais après tout, ce n'est peut être qu'une vilaine requête MySQL accédant à tes tables mal indexées...

Lien vers le commentaire
Partager sur d’autres sites

Merci pour tout. Effectivement il semblerai que linux voit 2 P4 3Ghz.

je vais voir au niveau de mes log car effectivement la machine tourne depuis un moment sans que j'y face le ménage. Il me reste encore pas mal de chose à apprendre et je pense que les pistes que vous venez de me donner me permettront d'y voir plus claire.

PS: si quelqu'un ce sent d'une âme charitable pour m'aider à paramétrer mon mysql, merci

Modifié par genmin
Lien vers le commentaire
Partager sur d’autres sites

Je viens de m'apercevoir que j'ai un énorme Handler_read_rnd_next = 2 G en 7h de fonctionnement, est ce que ca peut venir du fait que j'utilise des conditions style 'WHERE a.id=b.id' pour faire mes jointure plutôt que JOIN??

Lien vers le commentaire
Partager sur d’autres sites

Non la syntaxe ne devrait rien changer à cela.

Toutefois j'ai remarqué auprès de collègues qu'en utilisant la syntaxe "JOIN" les conditions de jointure étaient beaucoup moins souvent oubliées...

Pour la configuration de ton serveur MySQL, essaye de jeter un oeil sur WMC. Il y a même un outil qui aide à la configuration.

Lien vers le commentaire
Partager sur d’autres sites

merci pour ta réponse Kioob. Je viens de regarder mes fichiers log comme vu plus haut, et je ne sais pas si ça peut être une piste mais j'ai le log apache de mon site principal qui pèse plus de 200Go en moins de 4 jours, j'ai une rotation de 7 jours, et j'ai observé une charge du processeur du à un accès disque important jusqu'à 70% avant un plantage, une multitude de processus apache qui ce lance. puis le message 'too many connections' visible sur tout les site hébergé.

Le seul moyen trouvé pour arranger c'est arrêter apache, relancer mysql, puis relancer apache. Et on est reparti pour 2 jours avant que ça recommence

Lien vers le commentaire
Partager sur d’autres sites

Déjà mettre la rotation des logs Apache toutes les nuits ne serait pas du luxe : vu que tu as une debian, c'est dans /etc/logrotate.d/apache2 que ça se règle, il faut remplacer le weekly par daily et éventuellement diminuer la quantité de logs conservés (le rotate 52).

Pour ton blocage, c'est typique d'un blocage coté MySQL : une requête mal foutue verrouille une table importante, toutes les pages du site accédant à cette page se retrouvent bloquées, le nombre de connexions MySQL simultanées ainsi que de connexions Apache augmente fortement jusqu'à ce que la limite coté MySQL soit atteinte (too many connection), ou Apache ne réponde plus (nombre de slot arrivé à saturation), ou encore que la machine soit à genou (manque de mémoire => swap, etc).

Bien sûr, ce n'est pas forcément ça non plus... mais il faudrait commencer par regarder ce qu'il se passe vraiment plutôt que de tout de suite couper Apache et MySQL.

Faire un "show processlist" dans MySQL dans ces cas là te permet de voir ce qui a foutu un tel boxon.

Modifié par Kioob
Lien vers le commentaire
Partager sur d’autres sites

  • 2 semaines plus tard...

toujours le même problème. J'ai épluché les log après un plantage et je ne vois rien de particulier, peut être suis-je passé à coté de quelque chose...

Si quelqu'un à une autre idée. Merci

Lien vers le commentaire
Partager sur d’autres sites

As-tu essayé le "show processlist" dans MySQL durant le "plantage" ?

Le CPU était chargé ? Le disque ? la mémoire ?

Modifié par Kioob
Lien vers le commentaire
Partager sur d’autres sites

Posté (modifié)

Bonjour, merci Kioob pour ton aide, alors voici les quelques éléments que j'ai réussi à récolter durant le plantage.

déjà j'ai essayé de me connecter à mysql pour faire un 'show processlist' mais je suis tombé sur un 'ERROR 1040 (00000): Too many connections'

J'ai fait un ps -aux pour voir un peux ce qui tourne, et je suis tombé sur une 50 aine de processus apache, j'ai donc coupé apache puis j'ai réussi à me connecter à mysql. Entre temps j'ai fais un top qui m'indiquait une charge CPU de 160% de mysql, environ 50Mo de RAM libre et le swap non utilisé. par contre chose très étrange, un df -h ma montré que l'espace disque libre à brutalement diminué, passant de 34Go à 1.2Go en quelque minutes, mais toujours pas de swap utilisé d'après 'top'.

voisi le résultat du 'show processlist'

CODE
mysql> show processlist;

+-------+-----------+-----------+--------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+

| Id | User | Host | db | Command | Time | State | Info |

+-------+-----------+-----------+--------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+

| 24042 | eglantine | localhost | Eglantine_V2 | Query | 1028 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24046 | eglantine | localhost | Eglantine_V2 | Query | 1026 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24049 | eglantine | localhost | Eglantine_V2 | Query | 1022 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24054 | eglantine | localhost | Eglantine_V2 | Query | 1019 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24064 | eglantine | localhost | Eglantine_V2 | Query | 1015 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24065 | eglantine | localhost | Eglantine_V2 | Query | 1012 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24069 | eglantine | localhost | Eglantine_V2 | Query | 1002 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24071 | eglantine | localhost | Eglantine_V2 | Query | 1000 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24073 | eglantine | localhost | Eglantine_V2 | Query | 993 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24076 | eglantine | localhost | Eglantine_V2 | Query | 987 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24081 | eglantine | localhost | Eglantine_V2 | Query | 980 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24083 | eglantine | localhost | Eglantine_V2 | Query | 977 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24086 | eglantine | localhost | Eglantine_V2 | Query | 974 | Copying to tmp table | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24097 | eglantine | localhost | Eglantine_V2 | Query | 966 | Locked | UPDATE mandat SET date_vendu="0000-00-00", statut="En cours", pub="LOUCHATS ? mi-chemin entre BO |

| 24104 | eglantine | localhost | Eglantine_V2 | Query | 958 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24105 | eglantine | localhost | Eglantine_V2 | Query | 956 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24113 | eglantine | localhost | Eglantine_V2 | Query | 937 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24117 | eglantine | localhost | Eglantine_V2 | Query | 928 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24119 | eglantine | localhost | Eglantine_V2 | Query | 929 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24122 | eglantine | localhost | Eglantine_V2 | Query | 919 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24123 | eglantine | localhost | Eglantine_V2 | Query | 917 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24133 | eglantine | localhost | Eglantine_V2 | Query | 908 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24135 | eglantine | localhost | Eglantine_V2 | Query | 901 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24146 | eglantine | localhost | Eglantine_V2 | Query | 853 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24149 | eglantine | localhost | Eglantine_V2 | Query | 848 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24155 | eglantine | localhost | Eglantine_V2 | Query | 838 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24156 | eglantine | localhost | Eglantine_V2 | Query | 827 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24158 | eglantine | localhost | Eglantine_V2 | Query | 832 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24160 | eglantine | localhost | Eglantine_V2 | Query | 828 | Locked | SELECT id_mandat FROM mandat WHERE mandat.id_membre=3346 AND mandat.statut="En cours" AND mandat.dat |

| 24164 | eglantine | localhost | Eglantine_V2 | Query | 815 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24165 | eglantine | localhost | Eglantine_V2 | Query | 813 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24174 | eglantine | localhost | Eglantine_V2 | Query | 797 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24176 | eglantine | localhost | Eglantine_V2 | Query | 790 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24177 | eglantine | localhost | Eglantine_V2 | Query | 797 | Locked | SELECT id_mandat FROM mandat WHERE mandat.id_membre=3461 AND mandat.statut="En cours" AND mandat.dat |

| 24180 | eglantine | localhost | Eglantine_V2 | Query | 784 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24181 | eglantine | localhost | Eglantine_V2 | Query | 779 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24184 | eglantine | localhost | Eglantine_V2 | Query | 786 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24186 | eglantine | localhost | Eglantine_V2 | Query | 782 | Locked | SELECT * FROM mandat WHERE (mandat.statut='En cours' OR mandat.statut='Sign?') AND id_agence=5 AND ( |

| 24189 | eglantine | localhost | Eglantine_V2 | Query | 766 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24205 | eglantine | localhost | Eglantine_V2 | Query | 746 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24215 | eglantine | localhost | Eglantine_V2 | Query | 717 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24216 | eglantine | localhost | Eglantine_V2 | Query | 715 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24217 | eglantine | localhost | Eglantine_V2 | Query | 715 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24218 | eglantine | localhost | Eglantine_V2 | Query | 715 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24221 | eglantine | localhost | Eglantine_V2 | Query | 708 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24222 | eglantine | localhost | Eglantine_V2 | Query | 704 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24223 | eglantine | localhost | Eglantine_V2 | Query | 701 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24224 | eglantine | localhost | Eglantine_V2 | Query | 701 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24225 | eglantine | localhost | Eglantine_V2 | Query | 701 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24226 | eglantine | localhost | Eglantine_V2 | Query | 699 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24227 | eglantine | localhost | Eglantine_V2 | Query | 691 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24229 | eglantine | localhost | Eglantine_V2 | Query | 686 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24230 | eglantine | localhost | Eglantine_V2 | Query | 687 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24233 | eglantine | localhost | Eglantine_V2 | Query | 681 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24234 | eglantine | localhost | Eglantine_V2 | Query | 682 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24238 | eglantine | localhost | Eglantine_V2 | Query | 634 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24239 | eglantine | localhost | Eglantine_V2 | Query | 639 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24243 | eglantine | localhost | Eglantine_V2 | Query | 624 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24244 | eglantine | localhost | Eglantine_V2 | Query | 639 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24245 | eglantine | localhost | Eglantine_V2 | Query | 631 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24247 | eglantine | localhost | Eglantine_V2 | Query | 636 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24250 | eglantine | localhost | Eglantine_V2 | Query | 619 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24253 | eglantine | localhost | Eglantine_V2 | Query | 599 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24255 | eglantine | localhost | Eglantine_V2 | Query | 590 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24259 | eglantine | localhost | Eglantine_V2 | Query | 583 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24267 | eglantine | localhost | Eglantine_V2 | Query | 584 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24270 | eglantine | localhost | Eglantine_V2 | Query | 581 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24271 | eglantine | localhost | Eglantine_V2 | Query | 579 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24272 | eglantine | localhost | Eglantine_V2 | Query | 579 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24273 | eglantine | localhost | Eglantine_V2 | Query | 567 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24274 | eglantine | localhost | Eglantine_V2 | Query | 563 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24278 | eglantine | localhost | Eglantine_V2 | Query | 556 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24280 | eglantine | localhost | Eglantine_V2 | Query | 550 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24282 | eglantine | localhost | Eglantine_V2 | Query | 550 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24283 | eglantine | localhost | Eglantine_V2 | Query | 545 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24284 | eglantine | localhost | Eglantine_V2 | Query | 543 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24285 | eglantine | localhost | Eglantine_V2 | Query | 539 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24286 | eglantine | localhost | Eglantine_V2 | Query | 540 | Locked | SELECT ville.code, ville.commune as ville FROM mandat, adresse, ville WHERE (mandat.statut='En cours |

| 24287 | eglantine | localhost | Eglantine_V2 | Query | 536 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24288 | eglantine | localhost | Eglantine_V2 | Query | 529 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24289 | eglantine | localhost | Eglantine_V2 | Query | 530 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24290 | eglantine | localhost | Eglantine_V2 | Query | 531 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24294 | eglantine | localhost | Eglantine_V2 | Query | 517 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24295 | eglantine | localhost | Eglantine_V2 | Query | 513 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24298 | eglantine | localhost | Eglantine_V2 | Query | 516 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24299 | eglantine | localhost | Eglantine_V2 | Query | 517 | Locked | SELECT mandat.*, ville.code, ville.commune FROM mandat, adresse, ville WHERE (mandat.statut='En cou |

| 24301 | eglantine | localhost | Eglantine_V2 | Query | 517 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24302 | eglantine | localhost | Eglantine_V2 | Query | 508 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24303 | eglantine | localhost | Eglantine_V2 | Query | 516 | Locked | SELECT mandat.id_agence, mandat.id_mandat, mandat.prix, ville.commune, ville.code FROM coeur, mandat |

| 24305 | eglantine | localhost | Eglantine_V2 | Query | 509 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24307 | eglantine | localhost | Eglantine_V2 | Query | 495 | Locked | SELECT CONCAT( membre.prenom, ' ', membre.nom ) AS name, agence.tel, agence.fax, membre.statut, agen |

| 24309 | eglantine | localhost | Eglantine_V2 | Query | 437 | Locked | SELECT id_mandat FROM mandat WHERE mandat.id_membre=3306 AND mandat.statut="En cours" AND mandat.dat |

| 24311 | eglantine | localhost | Eglantine_V2 | Query | 415 | Locked | SELECT id_mandat FROM mandat WHERE mandat.id_membre=3306 AND mandat.statut="En cours" AND mandat.dat |

| 24317 | eglantine | localhost | Eglantine_V2 | Query | 236 | Locked | select mandat.id_agence from mandat where mandat.id_mandat='14666' |

| 24321 | root | localhost | NULL | Query | 1 | NULL | show processlist |

+-------+-----------+-----------+--------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+

95 rows in set (0.54 sec)

Je ne sais pas trop comment interpréter ceci mais j'ai pas bien voir autant de table tmp et de 'locked', vous en pensez quoi ?

Après avoir relancé mysql et apache l'espace disque est revenu à la normale 34Go, j'ai peut être un problème de swap de mysql non?

Merci

Modifié par genmin
Lien vers le commentaire
Partager sur d’autres sites

Hello,

on y voit déjà beaucoup plus clair je trouve.

Donc là en gros tu as une requête SQL bien pourrie (celle qui est bloquée en "Copying to tmp table") : pour une X raison MySQL ne peut pas la traiter directement et est obligé de passer par une table temporaire. Déjà ça c'est un mauvais point car pour cela MySQL pose un verrou sur la table, ce qui bloque toutes les autres requêtes qui utilisent la table (d'où les "Locked" sur les requêtes qui n'ont rien à voir).

Second point, cette table temporaire est trop grosse pour être traitée en mémoire (cette limite est configurable) et donc MySQL utilise le disque... ce qui est beaucoup plus lent.

Et finalement tu satures le nombre de connexions à MySQL et surcharge fortement Apache ; normal.

La première chose à faire est de corriger cette requête : 32Go d'espace utilisés par 13 requêtes ça nous ferait quand même plus de 2Go par requête, je ne connais pas la taille de tes tables mais là ça sent bien la jointure oubliée (et donc produit cartésien entre les tables, aïe).

Que donne un "EXPLAIN" de cette requête ? Quels sont les indexes sur ces 3 tables ? Quel est le volume de données de ces tables ?

Modifié par Kioob
Lien vers le commentaire
Partager sur d’autres sites

merci merci merci beaucoup,

Je viens de retrouver la requete en question, enfin j'espère et ce serai un problème de parenthèses. Enfin le temps nous le dira, j'espère que tout va rentrer dans l'ordre.

Je vous tiens au courant.

Lien vers le commentaire
Partager sur d’autres sites

Bjr,

N'attends pas que ca plante, va régulièrement faire un tour dans le process list, voir ce qui rame.

Là, soit tu as un problème de jointure, soit tu as un problème d'index, qui reviendrait à ralentir considérablement les tables, et reviendrait (à mon avis) au même.

Regardes ces 3 tables : mandat, adresse, ville

Regardes s'il y a bien des index, regardes si y'a bien les bonnes jointures dans les requètes que tu listes ci-dessus (surtout les premières. Les autres viennent s'agglutiner, ca compte pas ;) )

Lien vers le commentaire
Partager sur d’autres sites

Yep vérifie bien tes jointures comme l'indique Anonymus, car j'ai du mal à croire que des parenthèses puissent flinguer une jointure.

Et l'explain, ça donne quoi ? (dans phpmyadmin tu exécutes la requète en ajoutant le mot clé EXPLAIN juste avant le SELECT. Et si tu ne comprends rien au tableau qu'il va te sortir en résultat, tu nous le mets ici.)

Modifié par Kioob
Lien vers le commentaire
Partager sur d’autres sites

Et dans 'show process list', tu as un gros 'T' bleu (enfin.. chez moi ;) ) à gauche du tableau, avec des fleches.

Cliques dessus quand tu as plein de requètes, il va t'afficher les requètes en entier :)

Postes nous les 2-3 premières, histoire qu'on y voit plus clair :)

Lien vers le commentaire
Partager sur d’autres sites

Il y a de grandes chances pour que les 13 premières lignes en "Copying to tmp table" concernent la même requête, commencer par analyser celle ci devrait déjà aider.

Note : pour le "show processlist", si tu passes par le client MySQL standard c'est "show full processlist" pour avoir le code SQL complet.

Lien vers le commentaire
Partager sur d’autres sites

  • 2 semaines plus tard...

Bonjour à vous tous, c'était belle et bien la première requete qui plantait à cause de parenthèses manquantes. Merci à vous tous pour votre aide, j'ai enfin pu partir en vacances tranquile.

Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...