All Projects → digital-fabric → tipi

digital-fabric / tipi

Licence: MIT license
Tipi - the All-in-one Web Server for Ruby Apps

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to tipi

Jetty.project
Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
Stars: ✭ 3,260 (+1423.36%)
Mutual labels:  tls, ssl, https, http2, http-server
Acme client
Java ACME Client application
Stars: ✭ 77 (-64.02%)
Mutual labels:  tls, ssl, https, acme
Merecat
Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd
Stars: ✭ 69 (-67.76%)
Mutual labels:  tls, ssl, https, http-server
Kvantum
An intellectual (HTTP/HTTPS) web server with support for server side templating (Crush, Apache Velocity and JTwig)
Stars: ✭ 17 (-92.06%)
Mutual labels:  ssl, web-server, https, http-server
Nico
A HTTP2 web server for reverse proxy and single page application, automatically apply for ssl certificate, Zero-Configuration.
Stars: ✭ 43 (-79.91%)
Mutual labels:  tls, ssl, http2, http-server
Greenlock
Automatic SSL renewal for NodeJS
Stars: ✭ 30 (-85.98%)
Mutual labels:  tls, ssl, https, acme
Caddy
Matthew Holt began developing Caddy in 2014 while studying computer science at Brigham Young University. (The name "Caddy" was chosen because this software helps with the tedious, mundane tasks of serving the Web, and is also a single place for multiple things to be organized together.) It soon became the first web server to use HTTPS automatically and by default, and now has hundreds of contributors and has served trillions of HTTPS requests.
Stars: ✭ 35,966 (+16706.54%)
Mutual labels:  tls, web-server, https, http-server
Shgf
Simple HTTP golang framework
Stars: ✭ 13 (-93.93%)
Mutual labels:  tls, ssl, https, http2
Fenix
A simple and visual static web server with collaboration features.
Stars: ✭ 1,559 (+628.5%)
Mutual labels:  ssl, web-server, https, http-server
cryptonice
CryptoNice is both a command line tool and library which provides the ability to scan and report on the configuration of SSL/TLS for your internet or internal facing web services. Built using the sslyze API and ssl, http-client and dns libraries, cryptonice collects data on a given domain and performs a series of tests to check TLS configuration…
Stars: ✭ 91 (-57.48%)
Mutual labels:  tls, ssl, https, http2
Netcoreserver
Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 799 (+273.36%)
Mutual labels:  tls, ssl, https, http-server
Cppserver
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 528 (+146.73%)
Mutual labels:  tls, ssl, https, http-server
Beetlex
high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
Stars: ✭ 802 (+274.77%)
Mutual labels:  tls, ssl, https, http-server
Wolfssl
wolfSSL (formerly CyaSSL) is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3!
Stars: ✭ 1,098 (+413.08%)
Mutual labels:  tls, ssl, https
Tls Inspector
Easily view and inspect X.509 certificates on your iOS device.
Stars: ✭ 92 (-57.01%)
Mutual labels:  tls, ssl, https
Sslsplit
Transparent SSL/TLS interception
Stars: ✭ 1,371 (+540.65%)
Mutual labels:  tls, ssl, https
Tlslite Ng
TLS implementation in pure python, focused on interoperability testing
Stars: ✭ 119 (-44.39%)
Mutual labels:  tls, ssl, https
Terraform Provider Acme Old
ACME (Let's Encrypt) Support for Terraform
Stars: ✭ 211 (-1.4%)
Mutual labels:  tls, ssl, acme
Acmetool
🔒 acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Stars: ✭ 1,882 (+779.44%)
Mutual labels:  tls, ssl, acme
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (-31.78%)
Mutual labels:  tls, https, http2

Tipi - the All-in-one Web Server for Ruby Apps

Gem Version Tipi Test MIT licensed

What is Tipi?

Tipi is an integrated, feature-complete HTTP/S server for Ruby applications. Tipi is built on top of Polyphony, a robust, high-performance library for building highly-concurrent applications in Ruby. Tipi can be used to serve any Rack application or set of static files directly without having to employ a reverse-proxy such as Nginx.

Features

  • High-performance, highly concurrent web server based on Polyphony
  • Full support for HTTP/1, HTTP/2, WebSocket protocols
  • Built-in SSL termination for secure, encrypted connections
  • Automatic SSL certificates using ACME providers such as Let's Encrypt (WIP)
  • Automatic ALPN protocol selection for serving HTTP/2
  • Request and response body streaming for efficient downloads and uploads
  • Full support for Rack-based apps

Benchmarks

Caveat emptor: the following results were obtained with an ad-hoc, manual process. I am not really familiar with the servers I compared Tipi against, and I ran them in their default configuration (apart from setting the number of workers). Take these results with a bunch of salt.

Tipi Puma Falcon Unicorn
HTTP/1.1 138629 34573 40714 7438
HTTPS/2 56762 n/a 34226 n/a

Methodology

  • All servers ran the same "Hello world" Rack application
  • Each server was run with 4 forked worker processes:
    • Tipi: tipi -w4 -flocalhost:10080:10443 examples/hello.ru
    • Puma: puma -w 4 examples/hello.ru
    • Falcon: falcon -n 4 -b http://localhost:9292/ -c examples/hello.ru
    • Unicorn: unicorn -c u.conf examples/hello.ru with the configuration file containing the directive worker_processes 4
  • The benchmark results were obtained using wrk -d60 -t4 -c64 <url>
  • All servers were run on Ruby 2.7.2p137
  • Machine specs: [email protected] CPU, 8GB of RAM, running Linux kernel version 5.13.7
  • Puma does not support HTTP/2.
  • As far as I could tell Unicorn does not support SSL termination.

Running Tipi

To run Tipi, run the included tipi command. Alternatively you can add tipi as a dependency to your Gemfile, then run bundle exec tipi. By default

Tipi can be used to drive Rack apps or alternatively any app using the Qeweney request-response interface.

Running Rack apps

Use the tipi command to start your app:

$ bundle exec tipi myapp.ru

Running Qeweney apps

$ bundle exec tipi myapp.rb

The app script file should define an app method that returns a proc/lambda taking a single Qeweney::Request argument. Here's an example:

# frozen_string_literal: true

def app
  ->(req) { req.respond('Hello, world!', 'Content-Type' => 'text/plain') }
end

Setting server listening options

By default, Tipi serves plain HTTP on port 1234, but you can easily change that by providing command line options as follows:

HTTP

To listen for plain HTTP, use the -l/--listen option and specify a port number:

$ bundle exec tipi -l9292 myapp.ru

HTTPS

To listen for HTTPS connections, use the -s/--secure option and specify a host name and a port:

$ bundle exec tipi -sexample.com:9292 myapp.ru

Full service listening

The Tipi full service listens for both HTTP and HTTPS and supports automatic certificate provisioning. To use the full service, use the -f/--full option, and specify the domain name, the HTTP port, and the HTTPS port, e.g.:

$ bundle exec tipi -fmysite.org:10080:10443 myapp.ru

#If serving multiple domains, you can use * as place holder
$ bundle exec tipi -f*:10080:10443 myapp.ru

If localhost is specified as the domain, Tipi will automatically generate a localhost certificate.

Concurrency settings

By default, the tipi command starts a single controller and uses Polyphony to run each connection on its own fiber. This means that you will have a single process running on a single thread (on a single CPU core). In order to parallelize your app and employ multiple CPU cores, you can tell Tipi to fork multiple worker processes to run your app. The number of workers is controlled using the -w/--workers option:

# fork 4 worker processes
$ bundle exec tipi -w4 myapp.ru

You can also set Tipi to spawn multiple threads in each worker when in compatibility mode (see below.)

Compatibility mode

Note: compatibility mode is still being developed, and currently only supports HTTP/1 connections.

In some apps, using Polyphony is not possible, due to incompatibilities between it and other third-party dependencies. In order to be able to run these apps, Tipi provides a compatibility mode that does not use Polyphony for concurrency, but instead uses a thread-per-connection concurrency model. You can also fork multiple workers, each running multiple threads, if so desired. Note that the concurrency level is the maximum number workers multiplied by the number of threads per worker:

concurrency = worker_count * threads_per_worker

To run Tipi in compatibility mode, use the -c/--compatibility option, e.g.:

# 4 workers * 8 threads = 32 max concurrency
$ bundle exec tipi -c -w4 -t8 myapp.ru

Worker process supervision

Tipi employs a supervisor-controller-worker process supervision model, which minimizes the memory consumption of forked workers, and which facilitates graceful reloading after updating the application code.

This supervision model is made of three levels:

  • Supervisor - Starts and stops the controller process
  • Controller - loads the application code and forks workers
  • Worker - listens for connections, handles incoming requests

(If the worker count is 1, the Controller and Worker roles are merged into a single process.)

This model allows Tipi to fork workers after loading the app code, and use a much simpler way to perform graceful restarts:

  • The supervisor starts a new controller process (which may fork one or more worker processes).
  • Sleep for a certain amount of time (currently 1 second.)
  • Stop the old controller process.
  • Each worker process is gracefully stopped and allowed to finish all pending requests, then shutdown all open connections.

Performing a graceful restart

A graceful restart performed by sending SIGUSR2 to the supervisor process.

Documentation

Documentation for Tipi's API is coming soon...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].