Live data from Hacker News

KORE – A fast SPDY-capable webserver for web development in C

kore.io

11–20 of 60 posts

Re: KORE – A fast SPDY-capable webserver for web development in C

#11
post #3

It's ironic that the website isn't working. Alternate link? (GitHub perhaps?)

Looks to have returned. (https://kore.io for those coming now that the top link has changed.) Also see: https://github.com/jorisvink/kore/commit/e1183e22a6a7a970213...

Re: KORE – A fast SPDY-capable webserver for web development in C

#13
Okay here's a peeve of mine: just because something is in C ("no overhead!") doesn't mean it's faster than something in another language in all situations.

As an example, this server uses a thread pool architecture. This architecture will perform poorly with slow clients (common on the public Internet), servers which have to interact with slow disks or external services, and is useless for long-polling. It's only useful for CPU-bound applications when you can assume fast clients and short requests.

In fact, I could make this server grind to a halt by opening one connection per worker, issuing partial requests to each, then letting the connection hang. So to be used in production, this server will have to sit behind something like nginx, which can insulate your application from pathologically slow clients.

Re: KORE – A fast SPDY-capable webserver for web development in C

#14
post #4

Connection timeout? Brilliant idea, I especially love the SSL only. The web needs to move to pure SSL.

That is a by-product of being SPDY compliant. The SPDY spec doesn't allow for unencrypted traffic, which is just one reason we need to switch over.

Re: KORE – A fast SPDY-capable webserver for web development in C

#15
Would it be an interesting idea to create a framework for making webapps as nginx modules? Sure, it's a pain in the ass, but nginx is evented as opposed to thread pooled, and tried and tested. Because nginx takes up hardly any memory, you could run a single nginx instance and proxy to other nginx instances that are compiled purely to run the app.

Though the scope for creating critical vulnerabilities is huge.

Re: KORE – A fast SPDY-capable webserver for web development in C

#16

Would it be an interesting idea to create a framework for making webapps as nginx modules? Sure, it's a pain in the ass, but nginx is evented as opposed to thread pooled, and tried and tested. Because nginx takes up hardly any memory, you could run a single nginx instance and proxy to other nginx instances that are compiled purely to run the app. Though the scope for creating critical vulnerabilities is huge .

That sounds like OpenResty: http://openresty.org

Re: KORE – A fast SPDY-capable webserver for web development in C

#17

Web development in C, I love this.

It's just a server. Many sites sit behind nginx, a web server also written in C, as a reverse proxy but that doesn't make them "web development in C."

Edit: This is web development in C: https://github.com/jorisvink/kore_website/blob/master/src/si...

Re: KORE – A fast SPDY-capable webserver for web development in C

#18

Okay here's a peeve of mine: just because something is in C ("no overhead!") doesn't mean it's faster than something in another language in all situations. As an example, this server uses a thread pool architecture. This architecture will perform poorly with slow clients (common on the public Internet), servers which have to interact with slow disks or external services, and is useless for long-polling. It's only use…

Threaded servers are not necessarily slower than asynchronous architectures, though they can be. In fact, threaded models are coming back into fashion these days, and can (sometimes) be faster than asynchronous models when each thread is affine to a particular physical CPU. This is due to cache effects and the substitution of fast stack allocation for slow heap allocation.

Bazillions of threads using too much stack space have been a problem in the past, but these days servers have plenty of memory, and to some extent size can also be mitigated by tail call optimizations.

I don't think your particular DoS attack will work with this server, which implements an idle timer to recover stack space. However, they could go one step further and only allow worker threads to use n% of server memory, and killing old, slow connections when the thread is needed and the memory limit has been reached.

Re: KORE – A fast SPDY-capable webserver for web development in C

#19

Why web development in C? Seems like a headache.

Same reason people write things in Var'aq :

http://www.reocities.com/connorbd/varaq/index.html

The more "close to the metal" you can get and more awkward and painful it is to program in, the more cred you get. Actual ramifications of slow connections, long polling etc... be damned.

Come to think of it, how come we don't have a web server in Var'aq?

Re: KORE – A fast SPDY-capable webserver for web development in C

#20

Would it be an interesting idea to create a framework for making webapps as nginx modules? Sure, it's a pain in the ass, but nginx is evented as opposed to thread pooled, and tried and tested. Because nginx takes up hardly any memory, you could run a single nginx instance and proxy to other nginx instances that are compiled purely to run the app. Though the scope for creating critical vulnerabilities is huge .

There is such a framework: openresty

http://openresty.org/

It uses a wide range of 3rd-party nginx modules, and Lua as a scripting language, to form a nice little framework. Extraordinarily fast by any standards.

Post reply on HN