# Php-fpm take up all cpu resources

**URL:** <https://www.ruby-forum.com/t/php-fpm-take-up-all-cpu-resources/227841>\
**Category:** NGINX\
**Created:** [March 30, 2013, 4:17pm UTC](https://www.ruby-forum.com/t/php-fpm-take-up-all-cpu-resources/227841 "2013-03-30T16:17:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meteor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/839c29/32.png) [@Meteor](https://www.ruby-forum.com/u/Meteor)\
**Post date:** [March 30, 2013, 4:17pm UTC](https://www.ruby-forum.com/t/php-fpm-take-up-all-cpu-resources/227841/1 "2013-03-30T16:17:47Z")

</div>

Hi All,

In these days, php-fpm took up all cpu resources several times a day…  
Each php-fpm may take up 25% cpu resource which should be less than 5%  
in normal status.  
Below is the php-fpm.log.

[30-Mar-2013 22:18:47] NOTICE: about to trace 29600  
[30-Mar-2013 22:18:47] NOTICE: finished trace of 29600  
[30-Mar-2013 22:18:47] NOTICE: child 29599 stopped for tracing  
[30-Mar-2013 22:18:47] NOTICE: about to trace 29599  
[30-Mar-2013 22:18:47] ERROR: failed to ptrace(PT\_IO) pid 29599: Bad  
address (14)

At first, I though it’s caused by mysql. But when php-fpm took up all  
cpu resource, I found that there is no sql process in mysql.  
So I’m thinking this problem is caused by php-fpm.  
I’m using Freebsd, and I disabled ‘ktrace’ in kernel. And the error for  
php-fpm is that failed to ptrace(PT\_IO).  
Is it possible that this problem is caused by ktrace?  
Anyone can help?

---

<div class="post-metadata">

**Author:** ![Meteor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/839c29/32.png) [@Meteor](https://www.ruby-forum.com/u/Meteor)\
**Post date:** [March 30, 2013, 5:16pm UTC](https://www.ruby-forum.com/t/php-fpm-take-up-all-cpu-resources/227841/2 "2013-03-30T17:16:48Z")

</div>

> So I’m thinking this problem is caused by php-fpm.

This is not exactly php list and not really related to nginx, but you  
should  
start by at least telling your php version, there have been a bunch of  
bugs  
fixed regarding fpm and cpu hogging (also in php core itself) in past.

It can always be a poor php code (\<? while(true) { } ?\>) though but  
without  
the fpm backtrace it’s hard to tell.

rr
