PHP takes up a few ideas of CPU high

Source: Internet
Author: User

Today, when I was doing the test, I suddenly got a card, and I looked at it with top.

PHP takes up more than 70% CPU, the following steps:

1. Strace-o output.txt-t-tt-e-c trace=all-p PID

Result: checked the following. has been executing the read, write operation SQL statement

2. ll/proc/25066/fd/

The result: It's all sockets, it doesn't feel right.

3. Strace-t-tt-c-P PID

When interrupted with Ctrl + C, the result is: Read, write occupies the most time,

Here I'm kinda sure it's a SQL problem, put a few PHP persistent queue processes off the CPU occupancy rate immediately down

In fact, it is still possible to view the next php-fpm slow_log slow log but I looked under our configuration actually turned off.

In summary, the most used above is the use of Strace, specific usage reference: http://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316692.html

PHP takes up a few ideas of CPU high

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.