Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
PHP Programming Social Networks Apache

Facebook's HipHop Also a PHP Webserver 304

darthcamaro writes "As expected, Facebook today announced a new runtime for PHP, called HipHop. What wasn't expected were a few key revelations disclosed today by Facebook developer David Recordan. As it turns out, Facebook has been running HipHop for months and it now powers 90 percent of their servers — it's not a skunkworks project; it's a Live production technology. It's also not just a runtime, it's also a new webserver. 'In general, Apache is a great Web server, but when we were looking at how we get the next half percent or percent of performance, we didn't need all the features that Apache offers," Recordon said. He added, however, that he hopes an open source project will one day emerge around making HipHop work with Apache Web servers.'"
This discussion has been archived. No new comments can be posted.

Facebook's HipHop Also a PHP Webserver

Comments Filter:
  • GUI applications (Score:5, Interesting)

    by sopssa ( 1498795 ) * <> on Tuesday February 02, 2010 @08:09PM (#31003174) Journal

    While theres already several libraries intended for creating windows and interfaces with PHP, and to put them together into an executable file, this might greatly improve that area in PHP too. While being faster as well, being machine code it protects your code too.

    Along with making it work with Apache Web servers I hope someone works on this aspect too. PHP is really nice and fast to write. *ducks from the c/c++ coders*

    Definitely interesting project.

  • nginx (Score:1, Interesting)

    by Anonymous Coward on Tuesday February 02, 2010 @08:11PM (#31003208)

    How does this compare to nginx i wonder?

  • Re:GUI applications (Score:3, Interesting)

    by FooAtWFU ( 699187 ) on Tuesday February 02, 2010 @08:17PM (#31003282) Homepage
    Fast to write, sure, but "nice"? The language is a mess, its metaprogramming is weak, and its packaging system is almost as bad as C. If you want a "nice" language go for Ruby or even Python something. (I do Perl myself, which has its share of cruft and hacks, but at least I have a decent package/namespace system.)
  • Re:Ambitious (Score:4, Interesting)

    by shutdown -p now ( 807394 ) on Tuesday February 02, 2010 @08:45PM (#31003604) Journal

    They wrote their own webserver/php-interpretor

    They didn't write a PHP interpreter. They wrote a PHP-to-C++ translator.

    Also, I presume that "one-to-half percent" refers to further optimization opportunities after they've done that.

  • by FooAtWFU ( 699187 ) on Tuesday February 02, 2010 @08:47PM (#31003630) Homepage
    That just goes to show that with enough resources, you can brute-force anything.
    The question for you and me is: do you want to be the brute?
  • Re:i can hear it now (Score:5, Interesting)

    by ancientt ( 569920 ) * <> on Tuesday February 02, 2010 @08:54PM (#31003692) Homepage Journal

    I'm both sides.

    I love PHP when I need to throw something together fast (like today) but don't expect a lot of heavy use. I love PHP when I want to get some handy tools that I can easily hack into doing what I really want. Still, when I have a significant project, and server load starts to matter, I loathe trying to use PHP and would usually rather write it as Perl, sometimes even compiling (gasp) Perl into something about as efficient and a whole lot more reliable than if I tried to write it in C. If I were really serious, I'd write it in C, but a day's work in C is 30 minutes in Perl or 10 in PHP.

    Choice of language for me is about return on investment. I'm not a grand programmer, I don't have the luxury of getting comfortable programming, if I'm programming it means that I'm not spending time on the dozens of other issues confronting our IT department. Most of the time if we're doing any sort of serious project, we're buying service from somebody who does it better than I have time to, probably better than I could.

    If this HH thing (no, can't stand to type the real name) gets momentum then it could be really good for shops like ours. We could turn the tools we don't have time to do well into things that don't suck so much and the tools that we wouldn't think were worth the hardware into things we can afford to run.

  • Re:GUI applications (Score:3, Interesting)

    by ls671 ( 1122017 ) * on Tuesday February 02, 2010 @09:04PM (#31003774) Homepage

    > and being easy to find code to copy.

    Some use Joomla for the same reasons...

    I set up only 1 site with Joomla in order to try it. I guess it is OK if your site doesn't have sensitive data and that you do not mind having your site defaced once in a while ;-))

    I had the admin password changed by a remote attacker on the Joomla site. The attacker couldn't deface the site although because I filtered admin access at the reverse-proxy level, thanks god ;-))

    Anyway, I wouldn't use Joomla for any sensitive site and I am tempted to say the same about PHP. I figure that it should be possible to write PHP in a secure way but I haven't seen it yet. Default session handling is a joke in PHP with files in the /tmp directory (session hijacking). There is also many other aspects that are handled in a way that often makes me smile ;-))


  • duration of leak (Score:5, Interesting)

    by pikine ( 771084 ) on Tuesday February 02, 2010 @09:18PM (#31003854) Journal
    We're talking about C++ as a CGI script. Who cares about memory leaks that only last for the duration of an HTTP request, which is a fraction of a second? The real problem with memory leaks is when you have a long-running process like single-process web browsers.
  • Re:CPU usage... (Score:2, Interesting)

    by sopssa ( 1498795 ) * <> on Tuesday February 02, 2010 @09:47PM (#31004120) Journal

    Because they have already optimized most of the IO and DB related things. Since Facebook is one of the largest sites in the world, even small changes make huge changes with what infrastructure and server amounts they need. And in this case the improvement is 50%.

  • here we go... (Score:3, Interesting)

    by Tumbleweed ( 3706 ) * on Tuesday February 02, 2010 @10:16PM (#31004362)

    It's arguments like these that make me wish for a LLVM/JIT version of D that I could use instead of PHP. And then just compile the thing if I needed soopa-doopa performance.

    OR that REBOL had developed into a big open source platform.


    The fights between C++/C#/Java/JavaScript fanatics are fights about the different implementations/targets of the same obsolete programming syntax structures, and don't do anyone any good.

  • Analogy of the year (Score:3, Interesting)

    by oldhack ( 1037484 ) on Tuesday February 02, 2010 @11:07PM (#31004874)

    "Which is like saying an anus is almost like a vagina..."

    I bow down in respect. Somebody mark this post for posterity. It's only Feb 2, but this has to be the Analogy of the Year.

  • Re:GUI applications (Score:3, Interesting)

    by Gerald ( 9696 ) on Tuesday February 02, 2010 @11:41PM (#31005256) Homepage

    Why not go all the way and write a web server in sh []?

The absent ones are always at fault.