Linux – Attaching strace to 100% CPU Apache process – output

apache-2.2linuxstraceUbuntu

I am having a problem with Apache2 spawning processes that use 100% CPU.

Attaching strace to one of such processes produces no output sometimes and sometimes gives this:

2672  17:18:07 poll([{fd=14, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
2672  17:18:07 write(14, "\236\3\0\0\3SELECT FLOOR(((price_index."..., 930) = 930
2672  17:18:07 read(14, "\1\0\0\1\2\33\0\0\2\3def\0\0\0\5range\0\f?\0\r\0\0\0\10\0"..., 16384) = 85

I would be grateful for any ideas as to interpreting the above.

Best Answer

There is nothing crime. From the your output some script (mb php) create sql qury to db. You can crete much more info with using -s flag. E.g:

strace -pPID -s1024 > /tmp/mysql.pid.strace 2>&1