Features

Features

Itsi bundles a slew of essential modern web features into a single, easy-to-use package. Here’s a list of the essentials. Or jump straight in to install and configure for a deeper dive.

You don’t need to use all of the features listed below to benefit from Itsi. E.g.

  • Use it just as fast, robust and memory efficient Rack server.
  • Or as a reverse proxy that allows you to use plain-old Ruby for configuration.

Pick and choose just the features that make sense for you.

Web Essentials

Compression
  • zstd, br, gzip and deflate compression.
  • Conditional compression based on route, content-type and body size
  • Streaming compression
  • Serve static precompressed files from the file-system
  • gRPC compression (zlib and gzip)
  • See compression
CORS
  • Full control over CORS rules on a location-by-location basis.
  • See cors
ETag and Cache Control
  • Weak and Strong eTag support.
  • If-None-Match and If-Modified-Since support.
  • Automated etag generation for dynamic content (or forwarding of existing etags if present)
  • See etag and cache_control
Configurable Middleware
  • Expressive controls to apply middleware selectively on a request-by-request basis.
  • Expressive matching based on route, content-type and body size, hostnames etc.
  • A single Itsi process can support simultaneous running of several apps, each with specialized configuration.
  • See location
Redirects
  • Simple redirect functionality (all of permanent, temporary, found, moved_permanently)
  • HTTP to HTTPS Redirects
  • Dynamic URL Rewriting
  • See redirect
Reverse Proxy
  • Seamlessly Proxy to downstream HTTP services
  • Hostname and SNI overrides
  • Header overrides
  • Multiple backends per host, with load balancing and failover support
  • Automatic retries for Idempotent requests
  • Configurable error pages
  • See proxy
Range Requests
  • Partial content delivery support, so clients can resume downloads or stream large files efficiently.
  • See static_assets
Static File Server

Efficiently serves static assets with proper content types and caching headers.

  • Auto index generation
  • Configurable in-memory caching for faster serving of small and frequently accessed files.
  • Auto try .html extension (for cleaner paths)
  • Configurable fallback behaviour (e.g. route request misses to an index.html for SPAs)
  • See static_assets
Multiple Binds
  • Itsi can listen on multiple IP addresses or ports simultaneously for flexible deployment.
  • Unix socket binds (both plain-text and TLS) are supported.
  • See bind.

DevOps

File Watcher & Live Reloading
  • Monitors file changes and to automatically reloads configuration or content.
  • Use custom watchers to e.g. trigger frontend builds on file changes.
  • See local_development, auto_reload_config, and watch.
LSP and shell completion support
  • The bundled RubyLSP addon provides rich inline documentation and hover support when editing Itsi.rb files.
  • Shell completion support (add eval "$(itsi --install-completions)" to the bottom of your shell init file)
  • See local_development.
Status Reporting
  • Send SIGUSR2 to trigger detailed status report across all Itsi processes.
  • See signals.
Granular Logging
  • Support logging using plain-text and structured JSON formats.
  • Support STDOUT, file-system and combined log sinks.
  • Apply selective log levels for specific log targets only.
  • Configurable request logging middleware, with custom log templates.
  • See Request Logs & Logging.
Hot Config Reloads & Config File Validation
  • Zero-downtime config file reloads.
  • Phased restart support when running in cluster mode
  • Config file testing and dry-run functionality
  • See signals and auto_reload_config.
Configurable Error Responses
  • Provide your own exception responses (HTML and JSON) for all common exception scenarios, or simply rely on the light-weight defaults.
  • See error_responses.
Management Signals
  • Use a full suite of Unix signals to control your live Itsi cluster.
  • Add or remove workers on the fly, reload config, generate status reports etc.
  • See signals.

Security

JWT/API Key/Basic Auth
  • Apply common authentication patterns at the middleware layer.
  • API Key (bcrypt, argon2, sha256, sha512)
  • JWT (hs256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, PS256, PS384, PS512)
  • Basic Auth (bcrypt, argon2, sha256, sha512)

Itsi also comes bundled with a passfile generator, to help you manage your password hashes effectively.

Automatic Let’s Encrypt Certificates
  • Automated provisioning of Let’s Encrypt certificates.
  • File system caching of certificate data to avoid excessive API calls.
  • Supports usage of subject alternative names (SANs) for certificates that span multiple domains/sub-domains.
  • See certificates.
Automatic Development Certificates
  • Easily mirror your production SSL set-up in Development
  • Custom local CA generation (add this CA cert to your trusted root certificates for warning-less SSL during local development)
  • See certificates.
(Distributed) Rate Limiting
  • Combine any number of configurable rate limits
  • Support for a Redis backend for distributed rate limiting (falls back to in-memory backend)
  • In-memory backend for simple setups and local development.
  • See rate_limit.
Allow & Deny Lists
  • IP Allow lists to limit access to a specific set of IP addresses or blocks.
  • IP Deny lists to block access from specific IP addresses or blocks.
  • See allow_list & deny_list.
Intrusion Protection
  • Automatically scan request paths and headers for known malicious patterns
  • Configurable ban rules to block offenders for a specified duration.
  • See intrusion_protection
Slowhttp attack prevention
CSP Reporting
  • Simple configuration for enabling CSP headers.
  • Support for hosting a CSP reporting endpoint to track violations of CSPs running in reporting only mode.
  • See CSP

Protocols & Standards

HTTP2
  • Benefit from connection multiplexing by using http2 all the way from client to app/file server.
  • Itsi’s underlying HTTP1 and 2 implementations are provided directly by hyper. Itsi simply exposes these existing capabilities. This means that once h3 lands in Hyper - we’ll get it in Itsi too!
Rack Server
  • Rack compliant. Itsi plays nicely with your existing Rack-based applications and middleware.
  • See run and rackup_file
gRPC Server
  • Itsi is compatible with ruby grpc service handlers and can replace the official Ruby gRPC server implementation for a free performance boost!
  • Consider enabling non-blocking IO to further enhance performance.
  • Support for gRPC server reflection (use with tools like evans and Postman for easy service discovery)
  • Support for gzip and zlib compression
  • See grpc
gRPC+REST compatibility mode
  • Itsi provides a gRPC+REST compatibility layer for easy reuse of gRPC endpoints by clients and environments that are not gRPC capable. Invoke unidirectional and streaming endpoints using plain-old JSON.
  • See grpc
Note: This is not the same as gRPC with JSON which swaps out protobuf for JSON but still relies on gRPC’s underlying framing mechanics.
WebSockets

Concurrency & Performance

Cluster Mode
  • Supports running in a clustered mode, to fully leverage multi-core systems.
  • See workers.
Non-blocking(Fiber Scheduler) Mode
  • Support for Ruby’s fiber scheduler for non-blocking concurrency, boosting performance during I/O operations.
  • Use Itsi’s own high-performance built-in Fiber Scheduler or if your prefer you can bring your own!
  • See fiber_scheduler.
Hybrid Blocking/Non-Blocking Mode
  • Itsi allows you to split endpoints between using a Fiber scheduler versus running using the traditional blocking IO model. This allows you to dip your toes into the waters of Ruby’s new non-blocking IO, without having to port an entire application at once!
  • See scheduler_threads.
Non-blocking by design
  • Itsi is underpinned by hyper and tokio and as such is fundamentally an evented, non-blocking server. Whether you’re proxying, serving large files, or delegating to Ruby endpoints, Itsi remains responsive, even under heavy load.

Ruby

Preloading
  • Preload your Ruby application code before forking to benefit from reduced memory through CoW
  • Alternatively, use groups in bundler to target specific gems or dependencies for preloading
  • See preload.
Streaming Response Bodies
  • For both streaming and Enumerable bodies, Itsi sends data to the client as soon as it is available. This means modules like ActionController behave as expected, and the minimal buffering keeps Itsi’s memory footprint consistently low.
Streaming Request Bodies
  • Itsi supports streaming incoming request bodies too, for efficient processing of large simultaneous input streams (Disabled by default for maximum compatibility).
  • See stream_body.
Full & Partial Rack Hijacking
  • Itsi supports both full and partial Rack hijacking. Even over HTTP2!
By design, Full hijacking assumes you are writing a raw HTTP1 response directly to a raw connection stream. Itsi’s support for full hijack over HTTP2 is similar to what you would see if running a dedicated reverse proxy in front of a Ruby app. Itsi translates that request from HTTP1 to HTTP2, in real-time, allowing full hijacking endpoints to write HTTP1 and the client to receive HTTP2.
Sendfile
  • Itsi allows Ruby apps to set a X-Sendfile header to enable efficient, streaming file transfers, outside of Ruby, via fast native code.
  • See run and rackup_file.
ℹ️
Note that despite the header being named X-Sendfile, Itsi does not use the Sendfile system call, instead delegating the efficient streaming to Tokio’s native asynchronous file streaming capabilities.
Graceful Memory Limits
  • Itsi allows you to specify memory limits for Ruby processes. When the limit is reached, Itsi gracefully terminates the process and also invokes a dedicated after_memory_threshold_reached callback, so that you can log the event for further analysis.
  • See worker_memory_limit and after_memory_threshold_reached.
OOB GC
  • Itsi can be configured to periodically trigger GC every N idle periods (where an idle period is defined as a time where no requests are currently queued).
  • Periodic triggering of GC outside of the request flow can help reduce the impact of GC on latency.
  • See oob_gc_threshold
‘Rackless’ Ruby Apps
  • Itsi allows definition of ultra-light-weight Ruby web-apps, using plain old functions and procs.
  • For simple endpoints this barebones option can provide a substantial increase in throughput over a Rack request (primarily by avoiding allocating the env hash and response array)
  • See endpoint