Live data from Hacker News

PHP 7 deployment at Dailymotion

engineering.dailymotion.com

1–10 of 166 posts

Re: PHP 7 deployment at Dailymotion

#3
We did the same thing with HHVM, and had VERY similar results; getting it to work was plain hard, and i had a lot of concerns about our ability to ever go back.

Before we ever launched with HHVM completely, PHP7 came out. With only a few weeks of work, we managed to make the switch. The gains were identical to what we saw on HHVM, only the experience of working with PHP7 was so much easier for everyone involved.

Having said all this, I think HHVM served a great purpose: It raised the bar and PHP is better because of that. All in all, a great outcome for the people of the Internet.

Re: PHP 7 deployment at Dailymotion

#4
> It took less than a week to migrate our codebase (a 10 years old PHP monolith)...

> And it took 4 hours to migrate our custom extensions.

That seems like a very small amount of work; I'm impressed at how smooth a transition that must've been.

I'm also quite surprised that

> we can handle twice more traffic with same infrastructure.

Wow, I didn't think that PHP application code would be such a bottleneck. Maybe it's not that, but if the entire codebase is written in PHP, and you replace it all in one shot, you just get such an improvement. But I thought DBs, etc. would play a bigger role.

Re: PHP 7 deployment at Dailymotion

#7

> It took less than a week to migrate our codebase (a 10 years old PHP monolith)... > And it took 4 hours to migrate our custom extensions. That seems like a very small amount of work; I'm impressed at how smooth a transition that must've been. I'm also quite surprised that > we can handle twice more traffic with same infrastructure. Wow, I didn't think that PHP application code would be such a bottleneck. Maybe it's…

In the world of PHP 7, blocking I/O will still be a problem (at least, it was when I looked at the proposed feature set over a year and a half ago), but in PHP 5.x, the Zend engine is actually just incredibly inefficient, to the point where it is often the largest bottleneck on the request path.

Re: PHP 7 deployment at Dailymotion

#8

> It took less than a week to migrate our codebase (a 10 years old PHP monolith)... > And it took 4 hours to migrate our custom extensions. That seems like a very small amount of work; I'm impressed at how smooth a transition that must've been. I'm also quite surprised that > we can handle twice more traffic with same infrastructure. Wow, I didn't think that PHP application code would be such a bottleneck. Maybe it's…

For a lot of array-heavy applications (where you store all kinds of data in giant multi-level PHP arrays), the memory usage alone counts for most of the speedup; instead of wading through tens or hundreds of MB of array structures, PHP 7 trimmed things down by a factor of 2 or more.

There are a lot of PHP apps/CMSes/etc that gained 30-50% speedups due to just that improvement. Other more optimized apps/scripts saw a much more modest gain.

Re: PHP 7 deployment at Dailymotion

#10
post #9
post #5

Wow today is PHP day on HN :)

At least this one isn't ripping it to shreds (so far). The other discussion...that was rough to read as a PHP dev.

Don't take attacks on your usual tool of choice as an attack on yourself.

If you think people are making good arguments against PHP, perhaps consider retooling a bit...

Post reply on HN