News for hackers. Stuff that matters.
Re:PHP vs. Node.js: The REAL statistics by mtdewcmu on Monday June 09, 2014 @10:46PM (#7871638)
Indeed. That's what node.js is for. I was just nitpicking the article's explanation.

It would be interesting to see a breakdown of what makes the apache+PHP solution so slow. apache probably eats a lot of time by itself.

Are you using an opcode cache for PHP, like APC? The PHP script is being executed repeatedly, possibly being read, parsed and translated into bytecode each iteration. The Javascript gets compiled once into native code by v8 and just loops.

Re:PHP vs. Node.js: The REAL statistics by prahladyeri on Monday June 09, 2014 @11:44PM (#7871740)
The opcache is enabled and so is apc (though I don't think caching would matter much in this case).

As for apache eating time, nginx might run a bit faster than apache, but without a proper async I/O model built into the language itself (such as functional javascript), it would still be a band-aid solution.

Re:PHP vs. Node.js: The REAL statistics by mtdewcmu on Tuesday June 10, 2014 @12:00AM (#7871777)
True. I don't expect that nginx would make them equal. But it would be interesting to gather more evidence to support the hypothesis that async I/O is the difference.