Pro Tip: Upgrade to PHP7

Pro Tip: Upgrade to PHP7

As you probably figured out, we run a WordPress site which it in itself runs on PHP. Many complaints have surface around the performance of php 5.x and even hhvm came out as a result of that. We had a lot of interest in hhvm, but we never got it quite working. If you also use WordPress you probably also ran into some quirks when using hhvm. Because of that, we decided to remain with PHP 5.x. But the php developer community took notice, and decided to make the new version a worthy competitor of hhvm and the like. So here we are, with PHP 7 already released for sometime we decided to dive in and see what we got, and we liked it.

So how faster is php7 when compared to php5? Much I would say. I woud love to have tons of metrics to share but we don’t collect that many to begin with. However, we do have a few where you can see what we’re talking about:

1) Web Transaction Time

We had an average web transaction time of 350 ms with the low end around 300 ms and the high end around 500 ms. Php processing time took around 100 ms per request, so most of the time was spent doing web external calls. Fast forward to php 7 and we got an average web transaction time of 140 ms with the low end close to 100 ms and the high end around 230 ms. Basically we got it down to half! the php processing time ranges from 37.5 ms to 87.5 ms, but most is basically at 50 ms. This means that overall we were able to cut our web processing times in half both as a total and as just php processing times.

On a site note: We also saw a drop in our throughput with the same number of visitors (thereabouts)… so we are not sure what is driving that and if that is having an impact. Update: We found out a lot of those calls was a caching service that was preloading pages to accelerate the site… although seems at the end of the day it really was slowing it down. We also implemented better security at the login page which resulted in lower number of requests. So at the end of the day we would need to go back to php5 to make a fair comparison seeing we did other changes that also resulted in this positive results.

We are also observing a higher number of php warnings, hopefully the wordpress team will address those soon in a release.

2) Server usage

Overall our server usage also dropped. However, we also upgraded to a newer version of the OS which could also have an impact. Regardless, we are observing 1/3 memory usage overall like 1/5 CPU usage… although we never used much to begin with.

3) Front end

This is an even more subjective perspective. I have though, had a very positive impression using the web application. The time it takes for it to respond back I have noticed it is faster, which means something if a human being can notice it. Remember that although the page is generated in milliseconds on the web server, on average our pages are fully rendered after 9 seconds on the user’s browsers. Most of the time spent doing that is precisely page rendering right after COM processing. Most of our visitors use Google Chrome. Our faster load times are round across the norther part of the world (North America, Europe, Russia, while the slowest load times are found in Argentina, India, China and surprisingly Australia. We don’t receive visitors from all over the world, there are hardly any from Africa for example so take this information lightly.

Well, that pretty much ends the review of php7 from our side. We are really excited to see such positive results and glad the technology stack we use finally is mostly compatible with it. We look forward this improving our reader’s experience and satisfaction. Thanks!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.