First tests with #PHP7 in production at @AtrapaloEng

On Monday, Badoo blogged about its migration to PHP7 (https://techblog.badoo.com/blog/2016/03/14/how-badoo-saved-one-million-dollars-switching-to-php7/). Those are great results! At @AtrapaloEng, we’re running already tests in production to perform the same step. We could have started some months before, but we’ve been struggling with the php-msgpack extension and its (un)support for PHP7. We hope to deploy PHP7 in all our server during this week but we would like to share with you what we have seen so far. What we have done is adding another FPM node with the same capabilities as the current ones running in production with PHP 5.6. The new node is getting the same amount of traffic as the other ones. No special configurations or tweaks such as Huge Pages, just PHP7 upgrade. Data after more than 24 hours running.

Purple: FPM, PHP 7.0.4 (ngx24)

PHP 7.0.4-1~dotdeb+8.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Pink: FPM, PHP 5.6.14 (ngx23)

PHP 5.6.14-0+deb8u1 (cli) (built: Oct 4 2015 16:13:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Load average: Cut by half

Screen Shot 2016-03-16 at 09.50.49

Memory Usage: Cut by half

Screen Shot 2016-03-16 at 09.51.24

After more than 24 hours of running, memory usage is cut by more than a half.

Response time: Reduced by 25%-40%

At Atrápalo, we have tons of calls to external providers for getting content (hotel providers such as Booking and airlines companies), so most of the time we’re waiting to external resources, not pure PHP execution. Also consider some legacy code running too many queries in a single request. So considering that, global response time (including external resources and queries) with PHP7 improves between 25%-40%.

Unit Tests

We’ve got information about running our Unit Tests.

Tweet Unit Testing PHP7

Conclusion

It looks like there is no reasons to go for it. ;)

  • Quim

    Great! thanks for sharing. We are just beginning the same path here.
    Just a small correction: What’s cut by half is Memory Usage, Free Memory is indeed increased (doubled). Got me confused at first sight.

    • cbuenosvinos

      Fixed. Thanks!

  • Kevin Kinsey

    Hi Carlos … did you mean “no reason to NOT go for it?”