PHP 5.5/Wordpress running slow

September 1, 2014 3.4k views

I’ve got an Ubuntu 14.04 PHP 5.5 Wordpress 3.92 installation (using PHP5-FPM and Nginx).

Everything was going really well, until one of the clients created a very complex form (using Gravity Forms). He tested it on his personal dev server (Apache with PHP 5.4 and a local Mysql database) and the page loaded in about 2s - a bit slow but acceptable.

Then we copied it over to the DO server and the page refuses to load in less than 30s!

There is a load of spare RAM and originally the Mysql server was sat on a separate box, so to rule out network latency, I installed a db server locally - this has cut the time down to about 20s but it’s still way too high.

Looking at top, everything seems to be CPU bound - but I don’t understand why the (crappy) dev server would be OK and this production server isn’t. Opcache is on by the way.

Any ideas on what else I should try?

PS: I’ve installed a cache plugin, but unfortunately, most users will be logged in so I can’t rely on page-level caching (as there is user-specific stuff in the page header).

2 Answers

You can try installing HHVM to speed up your PHP code. I used the following guide to install it: [](http://). You can learn more about HHVM here: [](http://). And you can google up benchmarks to show that HHVM executes much faster than Zend.

Thanks for the suggestion.

However, I realised I was actually wrong - it was a 13.04 server, not 14.04.

Did a dist-upgrade and now it’s running as I would expect, rendering the form in less than a second.

No idea why the dist-upgrade would make such a difference, but I’m actually on an LTS release now, so I guess that plays a part.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!