4 ms·
ab has not been the bottleneck in the benchmarks since both servers were pinned to a single core. It is true that ab is too slow for benchmarking a HTTP server
by kazuho 12y ago
ab has not been the bottleneck in the benchmarks since both servers were pinned to a single core. It is true that ab is too slow for benchmarking a HTTP server running on multiple CPU cores, but it is at least faster than a server only using one core.
Regarding the performance of the HTTP parser, I have heard that picohttpparser (the HTTP/1 parser used by H2O) is much faster than the HTTP parser used by nginx.
https://github.com/kazuho/picohttpparser https://github.com/kazuho/picohttpparser
If that is true, it is likely due to the difference between the approaches the parsers take. Unlike most parsers, picohttpparser does not have a callback-based API. Instead it uses a loop for parsing the HTTP request and header lines.
note: This comment might be biased since I am the author of H2O and picohttpparser.
- deleted 12y ago[deleted]
- FooBarWidget 12y agoI believe you when you say that picohttpparser is faster. But is it also correct and secure? Is it fully RFC7230 compliant? Are there no parsing bugs that would allow a security exploit?
- kazuho 12y agoIt is hard to argue the secureness of a software, but I would say that if there are problems in the library it would be taken seriously. picohttpparser is the core of HTTP::Parser::XS which is used by many HTTP application servers for Perl (see http://plackperl.org http://plackperl.org). There are many deployments using it.