0

While load testing I am getting almost 100% CPU usage by Apache processes. To find out the root cause I attached Apache process with strace and found slow calls.

11840      0.000063 accept4(3, {sa_family=AF_INET, sin_port=htons(34640), sin_addr=inet_addr("54.208.xxx.xxx")}, [16], SOCK_CLOEXEC) = 17
11840     12.680738 getsockname(17, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.xxx.xxx")}, [16]) = 0

Apache configured with mod_php module. I think switching to mod_fastcgi might solve the problem but it's the final decision. Any ideas how to fix this issue?

Bobur Meliev
  • 101
  • 2
  • What options were used to generate that strace output? This info would clarify where the time was going. – Paul Haldane Mar 08 '16 at 08:11
  • strace -o /tmp/strace.out -f -r -s4096 -p PID – Bobur Meliev Mar 09 '16 at 03:46
  • OK - so based on what you've shown us, it's `accept4` which is taking a long time rather than `getsockname`. It's 12s between the start of `accept4` and the start of `getsockname`. This time hasn't necessarily gone to `accept4` - all that `strace` can tell you is that no other system calls have happened in that gap. – Paul Haldane Mar 09 '16 at 08:41

0 Answers0