为什么 PHP/Apache 组合会执行如此多的gettimeofday
系统调用?即使很快,每个电话都是应该考虑的电话。
只是一个快速strace -c -p [apache2 process id]
,给出以下内容:
Process 22294 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
98.52 0.010000 51 196 poll
1.48 0.000150 0 20752 gettimeofday
0.00 0.000000 0 94 7 read
0.00 0.000000 0 48 write
0.00 0.000000 0 96 32 open
0.00 0.000000 0 75 close
0.00 0.000000 0 6 chdir
0.00 0.000000 0 766 time
0.00 0.000000 0 2 chmod
0.00 0.000000 0 56 …
Run Code Online (Sandbox Code Playgroud)