Analyze MySQL Performance
Slow queries and Slowlog
MySQL optionally create a slowlog file or table.
Setup:
- Set
long_query_time = 1– Preferrable in my.cnf We may change that threshold up or down later, but this is a reasonable start. - Set up the
slowlogto be captured to FILE. - Turn on (the details of this vary with the Version)
- Wait at least 24 hours.
Writing slow_log to file – this is preferred, since there are tools for condensing such:
1 | |
Notes
Understanding MySQL Queries with EXPLAIN
SHOW PROFILE
The SHOW PROFILE and SHOW PROFILES statements display profiling information that indicates resource usage for statements executed during the course of the current session.
Analyze MySQL Performance
http://example.com/2020/03/01/Analyze-MySQL-Performance/