Skip to content
项目

关于

用于编写高性能、可靠网络服务的框架。

系统与基础设施

这些数字如何统计

可以做什么

  • Built on top of Tardy, an asynchronous runtime.
  • io_uring for Linux (>= 5.1.0).
  • epoll for Linux (>= 2.5.45).
  • kqueue for BSD & Mac.

实测星标增长

24小时
0
7天
+1
15天
+4
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

zzz

zzz logo

Discord

Installing

For in development zzz which uses tardy/main, secsock/main and Zig 0.18.0-dev.738+ae9a8acc7

zig fetch --save 'git+https://github.com/tardy-org/zzz?ref=main#commit_hash'

Else

Latest Release: v0.3.3 which uses tardy v0.3.3, secsock v0.1.3 and Zig 0.17.0

zig fetch --save 'git+https://github.com/tardy-org/zzz#v0.3.3'

You can then add the dependency in your build.zig file:

const zzz = b.dependency("zzz", .{
    .target = target,
    .optimize = optimize,
}).module("zzz");

exe.root_module.addImport(zzz);

zzz?

zzz is a framework for writing performant and reliable networked services in Zig. It supports both HTTP and HTTPS.

zzz currently supports Linux, Mac and Windows. Linux is currently the recommended target for deployments.

[!IMPORTANT] zzz is currently alpha software and there is still a lot changing at a fairly quick pace and certain places where things are less polished.

It focuses on modularity and portability, allowing you to swap in your own implementations for various things. Consumers can provide an async implementation, allowing for maximum flexibility. This allows for use in standard servers as well as embedded/bare metal domains.

For more information, look here:

  1. Getting Started
  2. HTTPS

Optimization

zzz is very fast. Through a combination of methods, such as allocation at start up and avoiding thread contention, we are able to extract tons of performance out of a fairly simple implementation. zzz is quite robust currently but is still early stage software. It's currently been running in production, serving my site.

With the recent migration to tardy, zzz is about as fast as gnet, the fastest plaintext HTTP server according to TechEmpower, while consuming only ~22% of the memory that gnet requires.

benchmark (request per sec)

Raw Data

benchmark (peak memory)

Raw Data

On the CCX63 instance on Hetzner with 2000 max connections, we are 70.9% faster than zap and 83.8% faster than http.zig. We also utilize less memory, using only ~3% of the memory used by zap and ~1.6% of the memory used by http.zig.

zzz can be configured to utilize minimal memory while remaining performant. The provided minram example only uses 256 kB!

Features

  • Built on top of Tardy, an asynchronous runtime.
  • Modular Asynchronous Implementation
    • io_uring for Linux (>= 5.1.0).
    • epoll for Linux (>= 2.5.45).
    • kqueue for BSD & Mac.
    • poll for Linux, Mac and Windows.
  • Layered Router, including Middleware
  • Single and Multithreaded Support
  • TLS using secsock
  • Memory Pooling for minimal allocations

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in zzz by you, shall be licensed as MPL2.0, without any additional terms or conditions.

探索相关项目

加载中…