News for hackers. Stuff that matters.
Re:What makes something "notable"? by FooBarWidget on Tuesday October 30, 2012 @05:34AM (#4716703)
I modded this submission up not because I agree with it but because I want a discussion. The G-WAN author has been known being... confident. He claims to be faster and more scalable than Nginx by a significant factor. He attributes the speed partially to the fact that his code contains few branches, where he defines even function calls as branches. Both statements are bold claims, and I can only imagine how it would take a genius to maintain "branchless" code like that.

Leaving that aside, I feel that the article focuses too much on the hype words. Yes some of the hype is over the top and focuses too much on the coolness factor, yes some of the reasons given for using Node is total nonsense (e.g. what he quoted from the Wikipedia article). But none of that invalidates the valid reasons for choosing Node:

- Javascript is so much easier to program for than C/C++. This is a fact; he mentioned it several times in his article but then brushes off these claims. Writing Phusion Passenger 4's new evented architecture in C++ has been an extremely intensive effort. There's just so much you need to be aware of and take care of, Javascript would have speeded up development significantly. If course we couldn't and didn't: being system software, Phusion Passenger's core cannot rely on Javascript and must be optimized for speed.

- Javascript is fast enough for quite a lot of server software. Of course C wipes the floor with everything. If you don't mind spending 4 times longer to ship your product to market. Oh yeah, good luck recruiting that brilliant C programmer, I hope you live in a place where they are easy to come by. His bold claim that G-WAN's Javascript engine uses 2444x less resources is a bold one, but if in the end you have 2 million users and you can still handle them with 1 or 2 servers, then switching to G-WAN does not give you a lot of added advantage.

- G-WAN runs everything in-process!! Of course everything is faster then!!! It's because there's no need to perform inter-process communication and CPU synchronization, which often require (relatively slow) kernel intervention. But if one component dies, your entire web server goes down. Better hope the application programmer never makes a mistake. With Phusion Passenger we've explicitly chosen not to utilize an in-process architecture because it causes to much pain, even if it's faster.

There's also at least one logical fallacy in the article:

_"Node.js' CPU & RAM usage is so high that the scale had to be resized. The chaotic curves do not give the feeling of anything seriously engineered."_

He puts two separate scales in the same graph and then claims this? That doesn't make any sense.

Where is the source code for the benchmark? How did the benchmark look like and what's the methodology? No mention of it.

I wish the G-WAN author would focus more on the technicalities instead of trying to fight the hype. That would make the entire article much more interesting. Why is G-WAN faster? What's the difference between Node and G-WAN's Javascript engine? Etcetera. G-WAN is a very interesting product but it would have so much more potential if the author communicates in a less inflammatory and emotional way, and behaves more professionally.

Re:What makes something "notable"? by klue on Wednesday October 31, 2012 @08:31AM (#4722473)
@FooBarWidget, an obvious Phusion Passenger troll (look at his posts)

> "Javascript is so much easier to program for than C"

G-WAN offers both. And 13 other languages.

> if you have 2 million users then switching to G-WAN does not give you a lot of added advantage

Node.js will never survive 2 million users if it faints at 1 thousand users.

> "Why is G-WAN faster?"

For the same reason that makes Nginx faster than Apache: better coding.

> "What's the difference between Node and G-WAN's Javascript engine?"

None. You criticize without reading. It is said that "G-WAN runs node.js as a script engine (which results in testing V8)".

> "Where is the source code for the benchmark?"

On the site that you claim that you have read.

> "G-WAN is a very interesting product but it would have so much more potential if the author behaves more professionally."

Hmmm... you probably mean, like you?

You "moderated" this Hackers News entry to:

  - spread FUD about G-WAN
  and
  - promote Phusion Passenger (your product)
Phusion Passenger is not censored on Wikipedia because, like Node.js, it is much slower than G-WAN.

Maybe that's why you ask how G-WAN manages to be so much faster?

Re:What makes something "notable"? by FooBarWidget on Saturday November 03, 2012 @08:23AM (#4736454)
> @FooBarWidget, an obvious Phusion Passenger troll (look at his posts)

Correction, I am one of the Phusion Passenger authors. I do not make this a secret.

You seem to have misunderstood my response for trolling. I apologize if I came over like that, but all I want is some critical discussion and better explanations than grand claims without proof.

> G-WAN offers both. And 13 other languages.

I never said it didn't. I merely said there are legit reasons for using Javascript over C.

> Node.js will never survive 2 million users if it faints at 1 thousand users.

> For the same reason that makes Nginx faster than Apache: better coding.

Ok, now give me some details. These statements are meaningless on their own. "will never survive" contradicts real-world examples in which Node obviously did survive. Also, under what hardware? What networks? What operating systems? Under what test conditions?

Nginx is faster than Apache because of "better coding"? That vague statement doesn't mean anything. Nginx is faster than Apache partially because of its architecture: evented vs multiprocessing/multithreading, speed at the cost of flexibility, memory allocation patterns, etc. Nginx isn't anywhere near the swiss army knife that Apache is, and as soon as it is it will become comparable in performance. I can pinpoint specific areas in Nginx and explain why they're faster than the equivalent in Apache. Can you do that with G-WAN vs the rest?

I'm looking an in-depth technical study of what makes G-WAN faster than the competition, not vague grand statements.

> On the site that you claim that you have read.

They have the source code for the benchmarking app but not the hello world app. Direct link please.

> You "moderated" this Hackers News entry to: > - spread FUD about G-WAN

Calm down, this isn't a war. I apologize if it come over as FUD, but it was merely critical curiosity.

> and > - promote Phusion Passenger (your product)

Correct. I make no attempt to hide this. In fact, I challenge you to find any promotional messages that are not based on facts. I do not, and do not want to, promote my products with FUD or inaccuracies.

> Phusion Passenger is not censored on Wikipedia because, like Node.js, it is much slower than G-WAN.

What do censoring and Wikipedia have to do with this? And correct, it is slower. We focus on ease of use, reliability, stability and features, not raw performance. If highest req/sec at the cost of everything else is what you want, then you are looking at the wrong product.

I cannot help but feel that your statement that Phusion Passenger is "much slower" than G-WAN is an attack in an attempt to defend G-WAN. Again, it is not my intention to troll or spread FUD on G-WAN.

> Maybe that's why you ask how G-WAN manages to be so much faster?

Yes, that is exactly why. As an application server author I am constantly seeking to improve my knowledge and skills in this area.

Performance is not always the end goal. It comes at a cost. Nginx is not faster than Apache because it's "better coded" but because of tradeoffs in architecture and features. Likewise, there are ways to make Phusion Passenger faster, but they come at the cost of reduced code maintainability, reduced feature set, etc.

And uhm, klue, whoever you are... please don't reply from a newly created account made for the mere sake of replying to me. I want a civilized, technical discussion, not a pissing contest. Please reply with your real account.

Re:What makes something "notable"? by 1SaltwaterC on Tuesday October 30, 2012 @06:31AM (#4716827)
There's no "G-WAN's Javascript engine". Just plain old V8 embedded via a handler. You get just the basics, no batteries included aka you need to code the bindings to various things (like FS, crypto, etc) by yourself.

A year ago, a member of the former G-WAN community wrote a handler and V8 wrapper: https://gist.github.com/1077769. Guess that the G-WAN author (Pierre) tweaked that a little bit more.

Tested it myself. For simple "hello world" it was 5.5x faster than node. Quite impressive given the fact that a new V8 context is created with every request. But, again, no batteries included.

Re:What makes something "notable"? by FooBarWidget on Tuesday October 30, 2012 @12:58PM (#4718246)
That makes me all the more curious: why is it faster? I cannot imagine Node doing something obviously wrong that would explain the difference. Evented I/O is pretty well understood, I/O loops aren't that hard and it's all just accept()/read()/write()/close() at the end of the day. Where does the 5x difference come from?
Re:What makes something "notable"? by 1SaltwaterC on Wednesday October 31, 2012 @05:10AM (#4721869)
It is plausible though. node.js have its fair share of "slowness" when compared to other async frameworks for the basic "Hello World" (shameless plug): http://www.saltwaterc.eu/async-frameworks-hello-world-showdo...

vert.x used the JavaScript bindings via Mozilla Rhino. I guess that a pure Java test could be a little bit faster than that.

Re:What makes something "notable"? by pibi on Friday November 02, 2012 @10:09PM (#4735670)
Because it caches (http://gwan.com/faq#cache) response under high concurrencies. Try to benchmark this code:

  #include "gwan.h" // G-WAN exported functions
  int count=0;
  int main(int argc, char *argv[])
  {
   if (!count) printf("New Counter!\n");
   xbuf_xcat(get_reply(argv), "Hello World %d",count++);
   return 200; // return an HTTP code (200:'OK')
  }
Re:What makes something "notable"? by FooBarWidget on Saturday November 03, 2012 @08:56AM (#4736494)
Wow, I didn't know that. I certainly did not expect to find that information in the FAQ. In fact this is the first time I've heard of a web server doing that.

So was the benchmark the author posted with microcaching turned on? While it's a legit way to reduce the load in real-world situations, it feels a little like cheating when used in a benchmark.

Re:What makes something "notable"? by riccardoforina on Tuesday October 30, 2012 @10:08AM (#4717373)