+0
日增长
9,425
stars
1,727
forks
376
watchers
2,324
prs
1,510
issues
0
releases
README
Seastar ======= Seastar is a C++ framework for writing high-performance server applications on modern multi-core hardware. It powers ScyllaDB, Redpanda, Ceph Crimson and other demanding systems. Seastar is written in modern C++, and supports C++23 and C++26. To build Seastar and use it in your own project, see BUILD.md. Philosophy ---------- Server frameworks have traditionally forced a choice between efficiency and the ability to build complex applications. Seastar aims for both: it lets you write large, complex servers while extracting the full performance of the hardware. Three principles make this possible: Composable primitives. Everything that can take time is represented by the same abstraction, a future: reading from the network, writing to disk, waiting on a timer, running a function on another core, or even a long CPU-bound computation. These operations compose freely. A single coroutine can read a request from a socket, fan out to several disks and cores in parallel, wait for the results, and reply, all written as straight-line code. Move operations to the data, not data to the operations. Seastar runs one thread per core (a shard) and partitions memory between them. Each piece of data is owned by a single shard; rather than locking the data and touching it from whichever core happens to need it, you send the operation to the shard that owns the data. There are no locks, no contended atomics and no cache-line bouncing on the fast path, so performance scales with the number of cores. Symmetric architecture. All shards have the same role. There are no dedicated network threads, I/O threads or worker pools; every shard runs the full stack (networking, storage, application logic, and a cooperative scheduler) for its own slice of the data. Adding cores adds capacity uniformly, and the whole application is built from one kind of component, replicated. Features -------- Futures, promises and coroutines: a complete asynchronous programming model. C++ coroutines (co_await) are the recommended way to write new code, and interoperate seamlessly with future-returning functions. Sharded services: seastar::sharded instantiates a service on every core and provides tools to invoke methods on one, some, or all shards, and to map-reduce across them. Concurrency primitives: semaphores, gates, condition variables, pipes, queues, abort sources, parallel loops (parallel_for_each, max_concurrent_for_each) and fork/join (coroutine::all). CPU scheduler: scheduling groups with configurable shares isolate application components from each other. Disk I/O scheduler: DMA-based, zero-copy file I/O using io_uring or Linux AIO, with a scheduler that models the disk's capabilities (as measured by iotune) to keep latency low while maximizing throughput. Networking: TCP, UDP, SCTP and Unix domain sockets on top of the POSIX stack, or an optional native userspace TCP/IP stack running over DPDK
Top issues
#2974RWF_NOWAIT breakage comes unnoticed77 comments · 2025-09-10#2696Horrible write IO performance on older kernels with the default of --poll-aio=137 comments · 2025-03-25#654Native stack bug when the num_cores > num_queues33 comments · 2019-06-18#2002RPC compression of large frames can stall29 comments · 2023-12-14#1784Crash/assert in seastar::aio_general_context::flush(): Assertion `clock::now() < retry_until' failed.24 comments · 2023-08-11#1778What is the recommended clocksource for Azure images23 comments · 2023-08-08#2398Revisit IO-queue wake from idle approach21 comments · 2024-08-22#871RPC framework: sending `sink` inside structures (specifically, `optional`)19 comments · 2021-02-25
Discussions
#3087Question1 comments · 2025-11-10#3044Seastar: per-shard TCP listeners not binding or exiting silently on non-0 shards4 comments · 2025-10-11#3029A better `with_timeout` feature?2 comments · 2025-10-06#2782seastar-25.05.0 released0 comments · 2025-05-27#2781New release2 comments · 2025-05-27#2758How to get the size here?3 comments · 2025-04-25#2750error: ‘this’ was not captured for this lambda function2 comments · 2025-04-21#2652Two file I/O questions0 comments · 2025-02-21