CentOS 7: PHP high CPU usage
- by HTF
I've migrated Observium monitoring platform from CentOS 6.5 to CentOS 7 and I've noticed high CPU usage mostly caused by PHP, the CPU load increase when pooling script is running (poller-wrapper.py). Both VMs are running on the same physical host (KVM hypervisor) with exactly the same spec.
I also tested this with a simple PHP benchmark script and CentOS 7 is slower - is it strictly related to PHP version (5.4.30 vs 5.4.16)?
CentOS 6.5
[root@centos6:~]# php -f bench.php
--------------------------------------
| PHP BENCHMARK SCRIPT |
--------------------------------------
Start : 2014-08-19 22:26:34
PHP version : 5.4.30
Platform : Linux
--------------------------------------
test_math : 1.610 sec.
test_stringmanipulation : 1.416 sec.
test_loops : 0.822 sec.
test_ifelse : 0.729 sec.
--------------------------------------
Total time: : 4.577 sec.
CentOS 7
[root@centos7:~]# php -f bench.php
--------------------------------------
| PHP BENCHMARK SCRIPT |
--------------------------------------
Start : 2014-08-19 22:27:58
PHP version : 5.4.16
Platform : Linux
--------------------------------------
test_math : 2.117 sec.
test_stringmanipulation : 1.246 sec.
test_loops : 1.174 sec.
test_ifelse : 0.752 sec.
--------------------------------------
Total time: : 5.289 sec.
CPU usage increased right after migration: