Answer the question
In order to leave comments, you need to log in
How to find the cause of high CPU usage by system calls from MySQL?
Good afternoon,
There is the following virtual machine configuration in VMWare ESXi 5.0:
1. CPU 2.0 GHz - 2 processors with 2 cores.
2. SCSI disk
3. Memory 2 GB
The following problem occurs. When loading the pages of the site, MySQL loads the processor cores at 100%. One request takes 10-15 seconds. But the download is not USER, but SysCall.
Here is a screenshot of htop:
And here are the strace results:
]# strace -c -p 1730
Process 1730 attached
Process 1730 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 98.314338 24578585 4 poll
0.00 0.001085 217 5 clone
0.00 0.000000 0 5 accept
0.00 0.000000 0 5 getsockname
0.00 0.000000 0 15 5 setsockopt
0.00 0.000000 0 30 fcntl
0.00 0.000000 0 1 restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00 98.315423 65 5 total
Answer the question
In order to leave comments, you need to log in
trite of course, but how are you with optimization? Are there indexes? Did the mysql configs correct?
You can see the log of slow requests.
in the presence of egregious cases - to do optimization.
here's what IMHO you can pay attention to:
1) View the explan of slow queries, if necessary, create the necessary indexes
2) do you use caching? (not only in the database, but in general)
3) what about the muscle configs? does it have enough memory? because you can have a lot of memory on the server, but the muscle itself cannot use it, it must be allowed.
in general, the search for bottlenecks on the server is a very interesting process ... but difficult ((good luck!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question