Scalable server design in Rust with Tokio

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • tokio-reuseport

  • The code linked in the article is quite explanatory - you have not a single listening socket, but per-core each.

  • sozu

    Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome!

  • it is not sufficient: a listen socket has its own queue of new TCP connections (that were already handshaked by the kernel), so dropping the listen socket drops the queue. The right way is to start the new server, transfer the listen socket from the old server to the new one with SCM_RIGHTS, then start accepting again from the new instance. That's how it is done in the sozu HTTP proxy (which also uses SO_REUSEPORT to launch multiple work processes each with their own listeners, to improve performance and isolate failure)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • grace

    Discontinued Graceful restart & zero downtime deploy for Go servers.

  • What you really need is a facility to pass down a socket from a process to another, like facebook's grace https://github.com/facebookarchive/grace (in go). This way you can guarantee you don't lose a single connection.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts