Slashdot Mirror


The Environmental Impact of PHP Compared To C++ On Facebook

Kensai7 writes "Recently, Facebook provided us with some information on their server park. They use about 30,000 servers, and not surprisingly, most of them are running PHP code to generate pages full of social info for their users. As they only say that 'the bulk' is running PHP, let's assume this to be 25,000 of the 30,000. If C++ would have been used instead of PHP, then 22,500 servers could be powered down (assuming a conservative ratio of 10 for the efficiency of C++ versus PHP code), or a reduction of 49,000 tons of CO2 per year. Of course, it is a bit unfair to isolate Facebook here. Their servers are only a tiny fraction of computers deployed world-wide that are interpreting PHP code."

21 of 752 comments (clear)

  1. Assumes PHP Dev Effort = C++ Dev Effort by VampireByte · · Score: 5, Funny

    What about all the cycles compiling and debugging C++ code? Or all the trees torn down for C++ books? Or the environmental impact of C++ developers? I mean, have you ever had to share a cube with one of them? Pheewww.

    --

    Run and catch, run and catch, the lamb is caught in the blackberry patch.

    1. Re:Assumes PHP Dev Effort = C++ Dev Effort by sznupi · · Score: 3, Funny

      Have no fear, turning devs into disposable resources will ensure bright future to efficiency being judged only in hardware terms.

      --
      One that hath name thou can not otter
  2. Re:Ridiculous by Sygnus · · Score: 5, Funny

    What about the impact of whole classes of C++ bugs that don't exist in C++

    I've spent many a sleepless night worrying about C++ bugs that don't exist in C++. I'm glad I'm not alone.

    --
    First posting isn't trolling. It's...first posting. :) -- Illiad
  3. The REAL solution by DoofusOfDeath · · Score: 5, Funny

    Just serve up plain text files. Anything else is pure decadence!

    1. Re:The REAL solution by Anonymous Coward · · Score: 1, Funny

      I agree. We can receive said text files via hand signals from the tree tops, to which we will have climbed back up after eschewing all technology to minimize our collective carbon footprints.

  4. Re:Languages not for everyone by Anonymous Coward · · Score: 4, Funny

    A PHP programmer who turns out good PHP code

    The Easter Bunny, Santa Claus, a PHP programmer who turns out good PHP code, and Steve Balmer are in the four corners of a room. In the center of the room is a chair. Who throws the chair first?

    Steve Balmer, because the other three don't fucking exist!

  5. Just think how much greener they could be... by John+Hasler · · Score: 1, Funny

    ...were they to rewrite it all in assembly language!

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  6. Re:php is bad for the environment by Barnett · · Score: 3, Funny

    Seriously, is somebody taking seriously the 1 to 10 ratio of the story?

    Only 1 to10 ?!? I would have thought 1 to 100.

  7. Take it further by Anonymous Coward · · Score: 1, Funny

    Code it in Asm, and you can get 100:1, so you can power down 29,700 machines...

    Better yet, make ppl. post all their wall posts directly in binary code. That way, you can destroy the code necessary to translate UTF-8 back-and-forth, the HTTP/MIME wrappers, and the SQL. Imagine the amount of electricity saved! You can market it as a brain-booster too, since now you have to think before you post on Facebook.

  8. Re:Languages not for everyone by Anonymous Coward · · Score: 3, Funny

    A PHP programmer who turns out good PHP code

    Ontological argument: A good PHP programmer is better than a PHP programmer that doesn't exist. Therefore a good PHP programmer must exist.

  9. Re:F1 car in normal street. by oddaddresstrap · · Score: 4, Funny

    You can go to work in a F1 car, or your normal car.

    I wish. My F1 always gets stuck in the gutter at the end of the driveway.

  10. Re:php is bad for the environment by Bruha · · Score: 5, Funny

    "even arp drags a server down when you have 20K+ connects"

    Are you perhaps a server admin in my company? I swear this is the best excuse for poor performance I've ever heard.

  11. Re:c++ is 'write-only' code by hedwards · · Score: 3, Funny

    Isn't that how things work in the real world? Your faucet is broken so you burn down the house. Seems like the logical way of dealing with it to me.

  12. Re:Languages not for everyone by orlanz · · Score: 5, Funny

    A self proclaimed good PHP programmer... yeah there are about a 100 of those to every 1 that doesn't do that.

  13. Re:A trolling weak argument by Anonymous Coward · · Score: 2, Funny

    Any point or argument based on assumptions is very weak.

    -Foredecker

    Assuming unreasonable assumptions of course.

  14. Re:php is bad for the environment by RichardJenkins · · Score: 4, Funny

    Don't forget to take account of the energy required to heat the water for the extra coffee it would take to build it in c++. People always forget about the coffee:production ratio.

  15. Time for Congress to legislate language efficiency by dirkdodgers · · Score: 3, Funny

    This is brilliant! I think it's clear now the direction we must go. Overuse of energy-guzzling languages like PHP have put us on an unsustainable trajectory fueling out of control global warming.

    Congress must act to regulate the use of these energy-guzzling languages. No longer will programmers and corporations be permitted to turn out inefficient code with impunity.

    PHP, Perl, Ruby, Bash, your days are numbered!

    Just wait until we can get UN involved. Python, you and your CO2 spewing simplicity are next!

  16. Re:c++ is 'write-only' code by debatem1 · · Score: 2, Funny

    "Faced with this piece of information, someone thought the logical thing to do was to, er, write an entirely new language?"

    by my understanding, the whole new language slant is because of the nightmare of c++ code out there to reuse, with unintended consequences. php is very web centric and java the last attempt at a 'universal' coding setup. python is an example of new language and how more complicated new language implementation is.

    Are you suggesting that they wrote PHP to avoid code reuse, that there hasn't been an attempt at a cross-platform language since Java, and that Python is complicated, all in the same paragraph?

  17. Plus, C++ is an environment-hostile choice by Jesus_666 · · Score: 3, Funny

    C++ is much too slow and carries too much of an overhead. And it usually requires an operating system on a general-purpose processor. You could go to hand-optimized binary code written directly for the processor but that still leaves us with inefficiencies.

    Imagine if every website was implemented as an ASIC. Then we could talk about efficient datacenters. Maybe, if you're relly strapped for cash, you could implement each website in an FPGA. But that should only be a stopgap measure until you can afford a proper implementation.

    --
    USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  18. Re:people use PHP? by rootofevil · · Score: 2, Funny

    I came here for an argument!

    --
    turn up the jukebox and tell me a lie
  19. Re:How about this comparison by wik · · Score: 2, Funny

    Alright wise guy. Explain twitter.

    --
    / \
    \ / ASCII ribbon campaign for peace
    x
    / \