
PHP 7 also brings a lot of fun new features that can make the life of the developers at Tumblr a bit easier. As you can see, the latency dropped to less than half, and the load average at peak is now lower than it’s previous lowest point! Language features These are graphs from one of the servers that handle our API. Not only were our servers serving pages twice as fast, they were doing it using half the amount of CPU resources. Almost immediately saw the latency drop by half, and the CPU load on the servers decrease at least 50%, often more. As we mentioned above, we were looking for performance improvements, but the real-world result was striking. When we rolled PHP 7 out to the first batch of servers we obviously kept a very close eye at the various graphs we have to make sure things are running smoothly. So at the end of this rollout, what were the final results? Well, two things stand out as big improvements for us performance and language features.
NEW TUMBLR LOADING PICTURE CODE
And since normal development continued alongside this project, we needed to make sure no new code was added that wasn’t PHP 7-proof, so we set up our CI tasks to run all tests on both PHP 5 and PHP 7. We also have a suite of unit and integration tests that helped a lot in identifying what wasn’t working the way it used to. It made it very easy to find the low-hanging fruit and fix those issues. In this project, we used it to find code in our codebase that would be incompatible with PHP 7. When doing upgrades like this it’s of course very important to test everything to make sure that the code behaves in the same way, and we had a couple of approaches to this. Two weeks later, after incrementally ramping up, every server responding to user requests was updated! Testing As things stabilized we started roping in more developers to do their day-to-day work on PHP 7-enabled machines.įinally, in the end of August we felt confident in our testing and rolled PHP 7 out to a small percentage of our production servers. Then, during the late spring and the summer, tests were run (more on this below), PHP package builds iterated on and performance measured and evaluated.
NEW TUMBLR LOADING PICTURE UPGRADE
In parallel, we ported our in-house PHP extensions to the new version so everything would be ready and available from the get-go.Ī small script was written that would upgrade (or downgrade) a developer’s server. One of the first things we did was package the new version up so that installation would be easy and consistent. This spring, things were starting to get more stable and we decided it was time to start looking in to upgrading more closely. At this point in time, quite a few PHP extensions did not have support for version 7 yet, but there were unofficial forks floating around with (very) experimental support. and got Tumblr running on one of the PHP 7 release candidates.

It all started as a hackday project in the fall of 2015. The whole upgrade was a fun project with some very cool results, so we wanted to share it with you.
NEW TUMBLR LOADING PICTURE FULL
Recently, in a cross-team effort, we upgraded our full web server fleet from PHP 5 to PHP 7. This means things like adding caching to heavily used codepaths, testing out new CDN configurations, or upgrading underlying software. At Tumblr, we’re always looking for new ways to improve the performance of the site.
