Bug #73265 [Com]: PHP7 dramatically slower in some cases

From: Date: Wed, 14 Dec 2016 23:39:20 +0000
Subject: Bug #73265 [Com]: PHP7 dramatically slower in some cases
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206009@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73265&edit=1 ID: 73265 Comment by: spam2 at rhsoft dot net Reported by: spam2 at rhsoft dot net Summary: PHP7 dramatically slower in some cases Status: Open Type: Bug Package: Performance problem Operating System: Linux PHP Version: 7.0.14 Block user comment: N Private report: N New Comment: and that memory usage is independet of load, here it is 00:38 AM and a few seconds after hard restart httpd all processes are afr above 100 MB, the fattest one cosumes 173 MB Previous Comments: ------------------------------------------------------------------------ [2016-12-14 23:36:56] spam2 at rhsoft dot net what i can assure you is that with 7.0.14 things got *much* worser and the system dropped down below 4 per second with "ab -c 20" and is raising OOM killers because each apache preforker in htop is showing 120 MB to 160 MB RES memory usage in htop while with PHP5.6 it was constantly around 50 MB this can not be opcache (or at least should not be) because shared memory typically is not counted as "resident" for each process Requests per second: 3.85 [#/sec] (mean) Time per request: 5198.089 [ms] (mean) Time per request: 259.904 [ms] (mean, across all concurrent requests) Transfer rate: 55.88 [Kbytes/sec] received ------------------------------------------------------------------------ [2016-10-07 14:05:31] spam2 at rhsoft dot net configuration is 100% identical, even the CFLAGS and ./configure as well as RPM sub-pckaging, two days before the upgrade i "backported" the RPM-SPEC and deployed a new 5.5.26 build something eats twice CPU it seems a second VM on the same host has exactly twice requests per second with PHP7 which is caused by the fact the VM has 12 instead of only 6 cores well, we will downgrade a developer machine on monday and try to compare xdebug outputs with PHP5 and PHP7, IMHO that should show changes in how expensive parts of the application are and lead to find the critical code paths hopefully we can nail that down to specific native php-functions which would lead in isolted loop cases and reprocuder-sample code, i guess the php developers are also curious in which bordercases the results go in the exactly wrong direction ------------------------------------------------------------------------ [2016-10-07 13:40:08] nikic@php.net Assuming you've already considered all the obvious causes (configuration and especially opcache), I'd suggest running your CMS through "perf record" + "perf report" and see what the top elements look like (on both versions). Additionally it wouldn't hurt to use strace to check whether there are any significant differences in IO/syscalls. ------------------------------------------------------------------------ [2016-10-07 11:58:40] spam2 at rhsoft dot net Description: ------------ we have two different inhouse cms-systems, while one is 46% faster with PHP7 the other one sucks terrible - are there things known by developers which are internally slower now while most other become afster and should be avoided? my first guess was mbstring but it's not, i have setup a cli environment with both php-versions + modules and a shell wrapper "php5" and "php7" and until now i am not able to find any isolted peice of code with a PHP7 slowdown it looks like others see similar results https://laracasts.com/discuss/channels/general-discussion/is-it-just-me-or-is-php-7-slow unluckily the cms developed by me is the faster one and now both have a difference of factor 30-36 Requests per second: 107.24 [#/sec] (mean) Time per request: 279.741 [ms] (mean) Time per request: 9.325 [ms] (mean, across all concurrent requests) Transfer rate: 1531.03 [Kbytes/sec] received Requests per second: 56.30 [#/sec] (mean) Time per request: 532.864 [ms] (mean) Time per request: 17.762 [ms] (mean, across all concurrent requests) Transfer rate: 803.75 [Kbytes/sec] received Test script: --------------- impossible to provide :-( Expected result: ---------------- have at least the same performance but not half Actual result: -------------- massive slowdown ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73265&edit=1

« previous php.bugs (#206009) next »