H2O - 一个超快的 HTTP 服务器(C 实现)
About H2O
H2O is a very
fast HTTP server written in C. It can also be used as a library.
Key Features
- HTTP/1.0, HTTP/1.1
- uses PicoHTTPParser
-
HTTP/2
- supports the final version 1
- negotiation methods: NPN, ALPN, Upgrade, direct
- dependency and weight-based prioritization
- server push
- WebSocket 2
- TLS
- static file serving
- conditional GET using last-modified / etag
- directory listing
- mime-type configuration
- reverse proxy
- HTTP/1.x only 6
- persistent upstream connection
- access-logging
- apache-like format strings
- graceful restart and self-upgrade
Benchmark
Remote Benchmark
Below chart shows the scores recorded on Amazon EC2 running two c3.8xlarge instances (server and client) on a single network placement 7.
Local Benchmarks
The scores (requests/second.core) were recorded on Ubuntu 14.04 (x86-64) / VMware Fusion 7.1.0 / OS X 10.9.5 / MacBook Pro 15" Early 2013.
HTTP/1.1 8Server \ size of content | 6 bytes | 4,096 bytes |
---|---|---|
h2o/0.9.0 | 75,483 | 59,673 |
nginx/1.7.9 | 37,289 | 43,988 |
Server \ size of content | 6 bytes | 4,096 bytes |
---|---|---|
h2o/0.9.0 | 272,300 | 116,022 |
tiny-nghttpd (nghttpd@ab1dd11) | 198,018 | 93,868 |
trusterd@cff8e15 | 167,306 | 67,600 |
Notes:
- also supports draft 14 and 16 for compatibility
- only usable at library level
- chacha20-poly1305; see also: Do the ChaCha: better mobile performance with cryptography
- automatically enabled
- internal memory is used as the storage
- HTTPS is not supported
- for reverse-proxy tests, another H2O process running on the same host was used as the upstream server
- used command: wrk -c 500 -d 30 -t 1; configuration file of nginx is here