If a worker wants to do his job well, he must first sharpen his tools. Let me explain my thinking
Ideas: 1. Determine the type of high load htop, use the dstat command to see if the load is high on CPU or IO 2. Monitor specific sql statements, whether insert update or delete causes high load Load 3. Check mysql log 4. Check for hardware problems
dstat
You can see which user and process occupy relevant system resources, and who is currently using the CPU and memory
Based on your question method, I can also derive a bunch of questions. You can experience it yourself
Title: My website access is very slow, how can I optimize it? Question: Any good ideas
Title: I want to double the performance of my website, how to achieve it? Question: Does anyone know?
Title: My server configuration failed, what happened? Question: Please help me
Excuse me, can you answer these questions? Can a one-sentence question without any details attract good answers? Then others have to guess your intentions, which wastes a lot of time.
If a worker wants to do his job well, he must first sharpen his tools. Let me explain my thinking
Ideas:
1. Determine the type of high load htop, use the dstat command to see if the load is high on CPU or IO
2. Monitor specific sql statements, whether insert update or delete causes high load Load
3. Check mysql log
4. Check for hardware problems
dstat
You can see which user and process occupy relevant system resources, and who is currently using the CPU and memory
htop
htop is an enhanced version of top, more intuitive
tcpdump
Capture mysql package analysis, generally capture the data of port 3306
Then use awk, sort, wc and other commands to analyze
or
You can see the busiest sql statements
strace
Check whether there is a problem with the system call, whether the process is blocked, and whether there is a Broken pipe
pt-query-digest
Analyze mysql slow logs to see which sql statements take the most time
show processlist
Check what the system is doing
Check whether there is any problem with the mysql configuration parameters, causing a large amount of IO or high CPU operations
Innodb_flush_log_at_trx_commit, innodb_buffer_pool_size, key_buffer_size and other important parameters
View current transactions and memory usage through show engine innodb status
Finally, use zabbix or cacti monitoring to check whether there are any abnormalities in IO, CPU, MEMORY, disk, etc.
This way you can basically find out the problem
For reference only, of course, different DBAs must have other better ways
Io? Cpu? Open the slow query log
Based on your question method, I can also derive a bunch of questions. You can experience it yourself
Title: My website access is very slow, how can I optimize it?
Question: Any good ideas
Title: I want to double the performance of my website, how to achieve it?
Question: Does anyone know?
Title: My server configuration failed, what happened?
Question: Please help me
Excuse me, can you answer these questions? Can a one-sentence question without any details attract good answers? Then others have to guess your intentions, which wastes a lot of time.