Answer the question
In order to leave comments, you need to log in
Why do processes on CentOS sometimes freeze for 100-300ms?
There is a Processor 2x Intel Xeon E5-2650v4 server, RAM 128 GB, Disks 4x480GB SSD, CentOS 7.3. It runs mysql, php-fpm, redis, nginx.
php-fpm status (morning):
Processes active: 6, idle: 144, Requests: 724543849, slow: 0, Traffic: 753req/sec
top - 11:09:19 up 447 days, 4:47, 1 user, load average: 9.66, 8.10, 7.90
Tasks: 651 total, 8 running, 643 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.9 us, 4.0 sy, 0.0 ni, 93.1 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st
KiB Mem : 13145292+total, 2053168 free, 38556552 used, 90843208 buff/cache
KiB Swap: 4194300 total, 3122176 free, 1072124 used. 88618272 avail Mem
1574322420.597333 fstat(3, {st_mode=S_IFREG|0644, st_size=76666, ...}) = 0 <0.000010>
1574322420.597358 mmap(NULL, 76666, PROT_READ, MAP_SHARED, 3, 0) = 0x7fbe917c2000 <0.000015>
1574322420.598163 mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbe7aa00000 <0.000014>
1574322420.894121 munmap(0x7fbe917c2000, 76666) = 0 <0.000024>
1574322420.894191 close(3) = 0 <0.000011>
Answer the question
In order to leave comments, you need to log in
Thank you all for your participation. I decided to just restart the server to check (uptime was more than 450 days), the lags disappeared.
Not exactly an answer, more of a tip - I'd try instrumenting the code (New Relic, AppDynamics, ...) and look at profiling results.
strace is certainly a good thing, but too low-level and old-school :-)
I agree with Vitaly Karasik about profiling a PHP application. You need to start by finding bottlenecks in the application and try to optimize them taking into account the load on the system.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question