Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I wanted to ask if someone can give me a hint how to identifiy a "high" CPU load problem with an PHP application. We are running our application with PHP-FPM PHP 5.3.27-1~dotdeb.0 with Suhosin-Patch (cli) (built: Jul 25 2013 19:30:39) and NGINX 1.2.7 on Debian 6 and recently got 5 new application servers. We decided to go with Debian 7, PHP-FPM 5.4.19-1~dotdeb.1 and NGINX 1.4.1 and since then we experience a higher load of on the new servers, which is ~2-5 times higher, sometimes even more, then on the old servers. I've installed PHP5-FPM 5.3 from source on one of the Debian 7 servers, since it's not available from packages anymore, but with no luck. We also use MongoDB 2.4.5 but it doesn't run on this machine, only the PHP MongoDB driver.

Screenshot from new and old server htop - On the left old Deb6, on the right side new server Deb7

Screenshot from new and old server htop - On the left old Deb6, on the right side new server Deb6

What I've tried so far:

  • Installed PHP 5.3 from source on new server
  • Installed NGINX 1.2.7 and run it with PHP 5.3
  • Diffed through php.ini, php-fpm.conf and our pool.d www.conf file to find any differences
  • Installed the MongoDB PHP driver via pecl in X different versions 1.3.0 - 1.4.4
  • Setup on 4th October the new server with Deb 6. Please see the second screenshot for result

What I havn't done yet:

  • Tried a higher PHP-FPM version on Debian 6, since we have to inform our provider to install the servers for us at the moment

Maybe I'm just overreacting (and my boss), but I think it's a strange behavior and we actualy bought this servers to have less to worry about a higher load in the furture.

Filesystem on old server:

Filesystem Type Size Used Avail Use% Mounted on
/dev/md2 ext4 1016G 229G 737G 24% /
tmpfs tmpfs 16G 0 16G 0% /lib/init/rw
udev tmpfs 16G 160K 16G 1% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
/dev/md1 ext3 496M 38M 434M 8% /boot
/dev/md3 ext4 1.8T 196M 1.7T 1% /home

Filesystem on new server:

Filesystem Type Size Used Avail Use% Mounted on
rootfs rootfs 92G 1.9G 86G 3% /
udev devtmpfs 10M 0 10M 0% /dev
tmpfs tmpfs 1.6G 264K 1.6G 1% /run
/dev/mapper/vg0-root ext4 92G 1.9G 86G 3% /
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs tmpfs 3.9G 0 3.9G 0% /run/shm
/dev/sda1 ext3 938M 35M 856M 4% /boot
/dev/mapper/vg0-home ext4 9.2G 149M 8.6G 2% /home
/dev/mapper/vg0-tmp ext4 7.4G 146M 6.9G 3% /tmp
/dev/mapper/vg0-var ext4 804G 1.5G 762G 1% /var

So basically on old server etx4 on Software RAID 1, without LVM and on new server ext4 on Hardware RAID 1 (LSI MegaRAID) with LVM2.

NEW RELIC:

We are running New Relic on our Application Servers, but only the lite version. Am I able to see anything specific in the lite version that could point me into solving the problem? What I see in New relic is that the new servers are having less throughput then the other servers, like the the throughput would be unbalanced. I checked the NGINX load balancer, but the config file seem's fine regarding the weight. I will dig into the Xdebug tool and post later some New Relic infos.

APC and Zend Opcache:

Thanks for the hint with the Zend Opcache. I installed Zend Opcache on the new server and it seem's to improve the CPU usage a little bit. It's still high compared to the old one though (but I will give it a try for future usage).

We are using APC and I've migrated the settings to our new servers by installing APC first, then comparing and adapting the settings from our old server to the new one and then rolling out via puppet. That's what I did with php.ini, php-fpm.conf and our pool.d www.conf. It drives me nuts.

Please notice the new Screenshot of the old and new Deb6 server.

Any help would be very appreciated. If you need any logs/files/etc. just let me know.

Cheers,
Szop

share|improve this question
    
What kind of filesystem and mount options did you have on the old servers, and what do you use now? –  pauska Oct 3 '13 at 10:20
    
Is your application suitable for profiling through new relic? If not, have you tried to obtain a Xdebug profile dump to identify at least where the load is being generated? –  Melvyn Oct 3 '13 at 17:41
    
Did the previous server use any opcode cache? Is the current server use the same with the same setting? If you were using APC in the previous server, then you may try Zend Opcache in the new server with PHP 5.4.x (due to an obsolete bug, PHP-FPM 5.3.x will not work with the latest version of Zend Opcache). –  Pothi Oct 4 '13 at 3:17
    
Does someone know why the "Tasks" line in htop might be so different? It's nearly twice that much on the old server. –  Szop Oct 4 '13 at 9:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.