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?

  • 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 8:44
  • Are you running php7.0 in fcgi or fpm?
    – Orphans
    Jan 25 '17 at 9: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? Jan 25 '17 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.