Live data from Hacker News

Nxweb – Fast and Lightweight Web Server

nxweb.org

21–30 of 75 posts

Re: Nxweb – Fast and Lightweight Web Server

#21
post #17

A lot of ad-tech companies build ad-servers in C, because the latency is so crucial in that context.

Or they don't know any better. I took part in a few projects that replaced high throughput servers handling mobile network traffic from C++ to Java.

Java is garbage unless you specific 20 -D options to bend it to your will.

Re: Nxweb – Fast and Lightweight Web Server

#22

Why? While Nxweb looks very promising, my first question would be 'Why should I use it over eg Nginx?' It would be helpful to have some direct comparison to other servers on the landing page. EDIT: Ok, there is a link to some odd benchmarks and it includes performance comparisons to Nginx and others which are not understandable (Nginx 141 req/s and Nxweb 200 / 121 req/s while it's not clear when 200 and when 121); mo…

The benchmarks also appear to compare to nginx v1.1.12 which is from 2011, not the latest nginx

Re: Nxweb – Fast and Lightweight Web Server

#23
post #16

A lot of ad-tech companies build ad-servers in C, because the latency is so crucial in that context.

Specifically it's garbage collection. e.g. node.js has no problem getting 20k/sec per core, but a stall at the wrong time kills every pipelined HTTP request that follows (until you tear down the connection and restart it).

[deleted]

Re: Nxweb – Fast and Lightweight Web Server

#25

They discount using CGI, which is fair enough, but why not use FastCGI? It's a sensible enough protocol, there are libraries for most languages and there's a good chance that your existing web server supports it. Technically, there's no good reason why a FastCGI based system would be significantly slower than a custom reimplementation like this.

> Technically, there's no good reason why a FastCGI based system would be significantly slower than a custom reimplementation like this.

An HTTP server speaking to a FastCGI application will:

• read the HTTP message

• decode HTTP

• encode FastCGI

• write to application

The FastCGI application will then:

• read the FastCGI message

• decode the FastCGI message

• do application stuff

• encode the FastCGI response

• write to the web server

The webserver then resumes:

• reading the FastCGI response

• decoding the FastCGI response

• writing the HTTP response

Meanwhile, an in-process HTTP server (like nxweb) system will simply:

• read the HTTP message

• decode HTTP

• do application stuff

• write the HTTP response

Less code runs faster; it is obvious to me why this is faster.

Re: Nxweb – Fast and Lightweight Web Server

#27
post #17

A lot of ad-tech companies build ad-servers in C, because the latency is so crucial in that context.

Or they don't know any better. I took part in a few projects that replaced high throughput servers handling mobile network traffic from C++ to Java.

Can confirm.

I work at two ad-tech related companies, one large one medium, both use Java from the beginning. And I know other company using Python/Golang as well.

Didn't know C(not C++) is particular popular until today. Note that ad company are pretty business focused, add or remove features for big clients are pretty common, so development efficiency matters a lot.

Re: Nxweb – Fast and Lightweight Web Server

#28
post #16

A lot of ad-tech companies build ad-servers in C, because the latency is so crucial in that context.

Specifically it's garbage collection. e.g. node.js has no problem getting 20k/sec per core, but a stall at the wrong time kills every pipelined HTTP request that follows (until you tear down the connection and restart it).

20k/sec is a joke performance. Java/Scala with Akka handles millions of packages per sec and this is performance.

Re: Nxweb – Fast and Lightweight Web Server

#30
Some questions:

1) Why you think that java is slower than C++? Server-side JIT compiles much more optimized code as it is really know what and how to optimize.

2) What about security? Almost half of the problems in security in last days came from native code stuff.

Post reply on HN