Congrats on shipping! This project looks very interesting already and will hopefully pick up more contributors.
Is there already support for configuration files? Because for me the performance isn't the most important issue, in fact the main reason I'm using nginx over Apache is that I don't want to deal with .htaccess any more.
I think if you would consider adding support for the nginx config file format to H2O, thus making it a drop-in replacement for it (if all the used features are actually supported), you could give the project a huge boost.
I'm skeptical of the performance numbers. First, like others here I don't believe nginx's performance will be a bottleneck for HTTP/2. Beyond that, I suspect there are cases in which this code is much worse than nginx.
Here's one. Look at the example request loop on <https://github.com/h2o/picohttpparser/>. It reads from a socket, appending to an initially-empty buffer. Then it tries to parse the buffer contents as an HTTP request. If the request is incomplete, the loop repeats. (h2o's lib/http1.c:handle_incoming_request appears to do the same thing.)
In particular, phr_parse_request doesn't retain any state between attempts. Each time, it goes through the whole buffer. In the degenerate case in which a client sends a large (n-byte) request one byte at a byte, it uses O(n^2) CPU for parsing. That extreme should be rare when clients are not malicious, but the benchmark is probably testing the other extreme where all requests are in a single read. Typical conditions are probably somewhere between.
Interesting article. And congratulations for the release!
Sorry this is a bit off-topic (and doesn't apply to H2O as it's been in the works for a while looking at the commits), but I wonder, today, with a language like Rust (1.0 is at the door [1]), as performant as its safe C equivalent but modern and safe by design (and with an escape hatch to C/C++ if needed), what would be the advantages of starting a long term project of this type in C today?
[1] http://blog.rust-lang.org/2014/12/12/1.0-Timeline.html
Edit: why the downvotes?
This doesn't look like a complete HTTP server, comparing it with nginx is not fair.
. It's missing content-encoding handling on the receiving side
. No http continue support
. No regex routing support
. No header rewrites
to name a few.
> Instead, switching back to sending small asset files for every required element consisting the webpage being request becomes an ideal approach
This doesn't solve the other side of the problem that spritesheets are meant to solve, namely that an individual image will not be loaded yet when the first UI element using it is displayed (e.g. in a CSS rollover, or new section of a SPA appears). I can't see a way that new protocols are going to solve this, unless I'm missing something in how HTTP2 is going to be handled by the browser?
I assume that once you're forced to preload everything you might need for the page, it's no longer more efficient to break up into multiple tiny requests.
Looking at the tangentially linked qrintf project that H2O uses ( https://github.com/h2o/qrintf ), replacing generic sprintf calls with specialised versions for a 10x speed boost - that seems like a brilliant idea, I wonder why it took so long for somebody to think of it?
Socket API is a bottleneck now, right? So, next step: roll your own http-friendly tcp stack on top of netmap/dpdk and get 10x performance increase over nginx.
Obviously it's great software. Does Kazuho work alone on this ? If it's meant to replace nginx, it needs a lot of other options/functions/extensions/modules/...
Is it getting commercial support/funds ?
Looks very promising!
I am not so much into web-servers (yet), but I found this in the feature list:
reverse proxy
HTTP/1 only (no HTTPS)
Are there any plans to add also HTTPS-support for reverse proxy? Since I have to include a secondary (Tornado) web-server unto my stack for dynamic pages.It also puzzled me, that https is not supported, but in the benchmarks I found a part: "HTTPS/2 (reverse-proxy)". As I said, I am not so much in Web-servers and https/2, but that was a little confusing.
That's a cool project. Performance is a fascinating topic.
However, in the real world, the number of requests per second a http daemon can perform is the last thing to worry about. If the web is slow, it's not because Apache used to be bloated with thread. It's because of bad architecture: centralization of services, latency in page builds time, size of static components, data store bottlenecks, etc...
Nevertheless, a very cool project. One I'll follow closely.
Another one to keep an eye on might be the new httpd in OpenBSD. http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/...
I'm not seeing that there is yet a portable version however.
If you're relying on HTTP for all your microservices, you're doing it wrong.
So, it has better string, pool allocators, zero-copy buffers and syscall support than nginx/core/*.ch? That would be a mirracle.
I love this kind of projects which people receive with much skepticism, but after some years will bring interesting improvements to us.
Hello there, can you share the performance test details? The configurations of both servers, client software, hwserver setups.
Thanks!
I couldn't understand why it could faster than Nginx? Maybe the way of benchmark nginx in this case is wrong?
That's a very good code. Succinct and readable. You clearly now your C well :)
Any plans to get script support, like nginx access_by_lua?
It seems that everything mentioned in the library could be done with golang easily. I am interested to see how H2O benchmarks with pure golang binaries.
whoa, and here i was thinking nginx was the be all end all of sweet sweet blistering speed...
Very nice work, competition is always good.
However, it seems worth mentioning that webservers haven't been a bottleneck for a long time now. Your bottleneck is always disk I/O, the network, or the slow application server that you're proxying to.
For reference: Wikipedia[1] serves roughly 8k pageviews/sec on average for a total of ~20 billion pageviews/month.
Assuming each pageview consists of ~10 webserver hits we're looking at ~80k requests/sec.
This is within the realm of a single instance of either nginx or h2o on a beefy machine [on a very beefy network].
So, unless you plan to serve Wikipedia or Facebook from a single server, you're probably fine picking your webserver software on the basis of features rather than benchmarks.
[1] http://reportcard.wmflabs.org/graphs/pageviews