Bug #10174
longues requetes SQL → 504 Gateway Time-out
Statut:
Rejeté
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
03 mars 2016
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Description
Sur le postgresql de prod j'ai activé l'option "log_min_duration_statement" pour les requêtes de plus de 5 secondes.
Voici ce qui ressort depuis /backoffice/management/statistics sur un site chargé de 10000 demandes, avant un « 504 Gateway Time-out » :
2016-03-03 14:34:48 CET LOG: duration: 23304.061 ms statement: SELECT DATE_TRUNC('month', receipt_time) AS month, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY month ORDER BY month 2016-03-03 14:35:12 CET LOG: duration: 23240.721 ms statement: SELECT DATE_TRUNC('year', receipt_time) AS year, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY year ORDER BY year 2016-03-03 14:35:35 CET LOG: duration: 23872.675 ms statement: SELECT DATE_PART('dow', receipt_time) AS weekday, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY weekday ORDER BY weekday 2016-03-03 14:35:50 CET LOG: duration: 25112.658 ms statement: SELECT DATE_TRUNC('month', receipt_time) AS month, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY month ORDER BY month 2016-03-03 14:36:00 CET LOG: duration: 24296.971 ms statement: SELECT DATE_PART('hour', receipt_time) AS hour, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY hour ORDER BY hour 2016-03-03 14:36:14 CET LOG: duration: 23315.742 ms statement: SELECT DATE_TRUNC('year', receipt_time) AS year, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY year ORDER BY year 2016-03-03 14:36:37 CET LOG: duration: 23295.451 ms statement: SELECT DATE_PART('dow', receipt_time) AS weekday, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY weekday ORDER BY weekday 2016-03-03 14:37:00 CET LOG: duration: 23157.412 ms statement: SELECT DATE_PART('hour', receipt_time) AS hour, COUNT(*) FROM wcs_all_forms WHERE receipt_time IS NOT NULL GROUP BY hour ORDER BY hour
Demandes liées
Historique
Mis à jour par Frédéric Péters il y a environ 8 ans
- Duplique Development #9553: requêtes SQL pour les graphes des stats globales ajouté