Show HN: Itsi – all-in-one HTTP server and proxy with first-class Ruby support

5 pointsposted 4 days ago
by Wouterken

3 Comments

Wouterken

3 days ago

For those who prefer just seeing some code over reading through the documentation, there's a bunch of minimal, realistic examples here:

https://github.com/wouterken/itsi/tree/main/examples

For each example you can take a look at the included README and take a look at the Itsi.rb, to get a little glimpse of some of Itsi's capabilities.

Alifatisk

3 days ago

Cool, is there any benchmarks on this?

Wouterken

2 days ago

Thanks for taking a look! I haven’t included any benchmarks in the repository (to avoid discussions focusing excessively on benchmarks that don’t reflect realistic or practical scenarios, rather than on other compelling features that have a greater impact in real-world use).

That said, it should be very fast across the board.

FWIW on my M1 Pro MacBook, if I run Itsi with a *single* worker and *single thread* (e.g. `itsi -w 1 -t 1`) I see these figures:

A hello world Rack app E.g. ->(env){[200, {}, ["hello world"]]}

Runs at approximately 100,000 requests per second using wrk http://localhost:3000 -c 60

A simple endpoint E.g. get "/" do |req| req.ok "Hello World" end

Runs at approximately 115,000 requests per second wrk http://localhost:3000 -c 60

Static file serving of small files (no compression) approaches 150K rps.

In essence, it should easily be fast enough that it's very unlikely that HTTP server performance is going to be the bottleneck in your workload except for the most extreme workloads.

All these numbers can increase further as you increase worker count. (There's many performance tuning knobs to twiddle)