2

So my intent was really to benchmark how our current app generates reports on php5, php7, and php7-fpm.

I did this by launching a 2gb instance on DigitalOcean with Ubuntu 16.04 and installing apache2 and php7. The test ran in about 9 seconds and generated a report 10 times (ab -k -c 2 -n 10).

Then I installed ppa:ondrej/php and upgraded and ran it again (still on php7.0, but now from the ppa). Result of 16 seconds was a bit surprising. I switched to php5.6 and it ran in 18 seconds.

Then I purged the ppa and restored php7 from the ubuntu repo and it ran in about 10 seconds again.

So why so slow?

Sarke
  • 411
  • 1
  • 5
  • 12
  • 1) It would help not just to put your question in the title. 2) Only two gigabit? That is 256 megabyte! (`b` vs `B` matters!) 3) It may just be a lot faster for one particular function? Did you test where CPU cycles/waits were in your program? – Hennes Jan 25 '17 at 08:44
  • Are you running php7.0 in fcgi or fpm? – Orphans Jan 25 '17 at 09:37
  • @orphans it's the default apache module for both, I didn't get to the fpm testing yet. – Sarke Jan 25 '17 at 10:18
  • @Sarke oh, that's a good question then. My guess is that php7.0 from ondrej is an older version. – Orphans Jan 25 '17 at 15:00
  • Are both versions configured in similar way, for example, do they both have OPCode caching enabled etc? – Tero Kilkanen Jan 25 '17 at 20:12
  • @TeroKilkanen both are default config, with opcache installed and enabled. I find it concerning because many people use ppa:ondrej/php for their php builds – Sarke Jan 26 '17 at 04:33
  • @TeroKilkanen I compared the configs, and the only difference were one or two patch version differences on xml and regex modules. – Sarke Jan 26 '17 at 07:08
  • @Sarke: Did you happen to find the root cause for this? I'm experiencing a similar issue – Akash Feb 16 '17 at 08:48
  • I did not, but I didn't really investigate further. You can try running xdebug and profile it. I suspect it has to do with more warnings and notices being thrown. – Sarke Feb 16 '17 at 08:50
  • I was able to reduce the load times in ppa package for php7.0 by disabling xdebug (sudo phpdismod xdebug). I'm unsure if relates to your evn, but you can try doing so as I noticed xdebug was enabled by default – Akash Feb 16 '17 at 12:42

0 Answers0