3 liens privés
Les outils linux pour savoir ce qui se passe.
http://www.brendangregg.com/Perf/linux_perf_tools_full.png
Performance User Group de Paris.
A lire plus tard
dtrace : disque et réseau
strace <programme> : tous les appels systèmes, mode debug, donc performance tombe à 0
opensnoop : moins gourmand que strace, se base sur le nom du process. Fichier script (bash) https://github.com/brendangregg/perf-tools/blob/master/opensnoop
netcat, netstat : réseau (pour netstat, option -tunapl)
ngrep, tcpdump : espion réseaux
perf : fonction système qui prenne du temps, pour faire des flamegraph
Thanks Julia !
(via http://sebsauvage.net/links/?5Kxo5A via Sam&Max)
et j'ajoute :
pmap <pid>
(via http://sametmax.com/verifier-la-ram-que-consome-un-process-sous-linux-avec-pmap/)
Et un exemple :
strace -o <file> -f -e trace=all -p <pid>
Grapher les sorties vmstat
– durability setting ( innodb_flush_log_at_trx_commit = 0 or 1 ) ?
– do we use binary logs ( I used ROW based replication for 5.1)
– do we have sync_binlog options.
Utilisation CPU d'une JVM
-XX:+PreserveFramePointer
Bientôt dans toutes les bonnes JVM
Tout est dit : sar grapher
/coude (via https://geekz0ne.fr/shaarli/?kBiReg)
Résumé des commandes :
uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
sar -n TCP,ETCP 1
top
jmeter performance tuning
Performance SQL
mysql / mariadb performance tip
iotop
dstat
while true; do date; ps auxf | awk '{if($8=="D") print $0;}'; sleep 1; done
quel outil pour observer linux (via http://sebsauvage.net/links/?FdQLWg)
pour afficher les informations qui sont tracées dans le schéma de performance.
select * from setup_consumers;
events_stages_current NO
events_stages_history NO
events_stages_history_long NO
events_statements_current YES
events_statements_history NO
events_statements_history_long NO
events_waits_current NO
events_waits_history NO
events_waits_history_long NO
global_instrumentation YES
thread_instrumentation YES
statements_digest YES
Vider les tables du schéma de performances :
truncate table events_statements_current;
truncate table events_statements_history;
truncate table events_statements_summary_by_digest;
- dans la page, affichage des requêtes pendant 60 secondes :
use performance_schema;
update setup_consumers set enabled='YES' where name IN ('events_statements_history','events_statements_current','statements_digest');
truncate table events_statements_current; truncate table events_statements_history; truncate table events_statements_summary_by_digest;
do sleep(60);
select now(),(count_star/(select sum(count_star) FROM events_statements_summary_by_digest) * 100) as pct, count_star, left(digest_text,150) as stmt, digest from events_statements_summary_by_digest order by 2 desc;
update setup_consumers set enabled='NO' where name IN ('events_statements_history','events_statements_current','statements_digest');
Un ensemble de requêtes pour utiliser le schéma de perf :
http://www.markleith.co.uk/ps_helper/#statements_with_runtimes_in_95th_percentile
http://www.markleith.co.uk/ps_helper/#statements_with_full_table_scans
Pour les requêtes :
SELECT * FROM performance_schema.events_statements_summary_by_digest;
Top par SUM :
SELECT schema_name, digest, digest_text, count_star, round(AVG_TIMER_WAIT/1000000000), sum_errors, sum_warnings, sum_rows_affected, sum_rows_sent, sum_rows_examined FROM `events_statements_summary_by_digest` ORDER BY `events_statements_summary_by_digest`.`SUM_TIMER_WAIT` DESC
Top par SUM avec Full Scan :
SELECT DIGEST_TEXT AS query,
IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan,
COUNT_STAR AS exec_count,
SUM_ERRORS AS err_count,
SUM_WARNINGS AS warn_count,
ROUND(SEC_TO_TIME(SUM_TIMER_WAIT/1000000000000)) AS exec_time_total_second,
ROUND(SEC_TO_TIME(MAX_TIMER_WAIT/1000000000000)) AS exec_time_max_second,
ROUND((AVG_TIMER_WAIT/1000000000)) AS exec_time_avg_ms,
SUM_ROWS_SENT AS rows_sent,
ROUND(SUM_ROWS_SENT / COUNT_STAR) AS rows_sent_avg,
SUM_ROWS_EXAMINED AS rows_scanned,
DIGEST AS digest
FROM performance_schema.events_statements_summary_by_digest ORDER BY SUM_TIMER_WAIT DESC LIMIT 15
des hints pour la performance :
- index inutilisés (SELECT object_schema, object_name, index_name FROM performance_schema.table_io_waits_summary_by_index_usage WHERE index_name IS NOT NULL AND count_star = 0 ORDER BY object_schema, object_name;)
- table temporaire
Intéressant : select * from file_summary_by_instance order by count_read desc,count_write desc limit 5