Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't bother trying to implement something complicated with multi-processing in PHP. The article defeats itself: "If you need multi-threading, use a different language."


Oh yeah? Why not?

We built a self-scaling multi-processing conversion system entirely in php @ http://massify.com/. In like 2-3 weeks. Had it deployed a week after that. It's been running for 2+ years with zero maintenance and handles all of the video, image, audio and office docs -> swf conversions. It's not a trivial system, but for what it does is simple enough to be beautiful despite the language it was built in.

It was designed to completely share nothing, message based, isolated, fault tolerant. I could go into the architecture more if you are interested.

Now Massify is not youtube scale, but this could scale to that size with minor adjustment (mostly with balancing uploads to the upload handlers). In it's current incarnation, the thing will scale by itself to whatever restraint Amazon puts on it.

We had one film contest were we watched the thing spin up a ton of ec2 instances and then tear them down when it was done. It was a little like watching an army of media converting robots.

So I was going to write this long winded thing about why I used PHP to do it, but at the end of the day it really doesn't matter. All that matters is that it works and works well. If writing this kind of stuff in PHP doesn't appeal to you, then cool, good for you. But your notion that it can't be done or done well is not grounded in any kind of reality.


Interesting. I would like to see some more details on that solution?


It's when people write solutions like this that I realize that PHP is very undervalued as a general purpose language. Sure, as a web language there is a ton of bad code out there because it's easy to learn. But for writing more advanced CLI systems it actually has a lot of nice functionality. See http://www.php.net/manual/en/refs.fileprocess.process.php


Are you talking about the same multi-processing technique as the article?


More details please. And great response.


Agreed. But it is a good way to tinker and learn the basics of multiprocessing if your only background is in PHP. The same concepts and terminology apply to other programming languages also running on *nix.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: