4 [![CircleCI](https://circleci.com/gh/scylladb/seastar.svg?style=svg)](https://circleci.com/gh/scylladb/seastar)
5 [![Version](https://img.shields.io/github/tag/scylladb/seastar.svg?label=version&colorB=green)](https://github.com/scylladb/seastar/releases)
6 [![License: Apache2](https://img.shields.io/github/license/scylladb/seastar.svg)](https://github.com/scylladb/seastar/blob/master/LICENSE)
7 [![n00b issues](https://img.shields.io/github/issues/scylladb/seastar/n00b.svg?colorB=green)](https://github.com/scylladb/seastar/labels/n00b)
12 SeaStar is an event-driven framework allowing you to write non-blocking,
13 asynchronous code in a relatively straightforward manner (once understood).
14 It is based on [futures](http://en.wikipedia.org/wiki/Futures_and_promises).
19 For more details and alternative work-flows, read [HACKING.md](./HACKING.md).
21 Assuming that you would like to use system packages (RPMs or DEBs) for Seastar's dependencies, first install them:
24 $ sudo ./install-dependencies.sh
27 then configure (in "release" mode):
30 $ ./configure.py --mode=release
35 $ ninja -C build/release
38 If you're missing a dependency of Seastar, then it is possible to have the configuration process fetch a version of the dependency locally for development.
40 For example, to fetch `fmt` locally, configure Seastar like this:
43 $ ./configure.py --mode=dev --cook fmt
46 `--cook` can be repeated many times for selecting multiple dependencies.
50 ----------------------------------------------------------------------------
52 The configure.py script is a wrapper around cmake. The --mode argument
53 maps to CMAKE_BUILD_TYPE, and supports the following modes
55 | | CMake mode | Debug info | Optimi­zations | Sanitizers | Allocator | Checks | Use for |
56 | -------- | ------------------- | ---------- | ------------------ |------------- | --------- | -------- | -------------------------------------- |
57 | debug | `Debug` | Yes | `-O0` | ASAN, UBSAN | System | All | gdb |
58 | release | `RelWithDebInfo` | Yes | `-O3` | None | Seastar | Asserts | production |
59 | dev | `Dev` (Custom) | No | `-O1` | None | Seastar | Asserts | build and test cycle |
60 | sanitize | `Sanitize` (Custom) | Yes | `-Os` | ASAN, UBSAN | System | All | second level of tests, track down bugs |
62 Note that seastar is more sensitive to allocators and optimizations than
63 usual. A quick rule of the thumb of the relative performances is that
64 release is 2 times faster than dev, 150 times faster than sanitize and
65 300 times faster than debug.
67 Using Seastar from its build directory (without installation)
68 ----------------------------------------------------------------------------
70 It's possible to consume Seastar directly from its build directory with CMake or `pkg-config`.
72 We'll assume that the Seastar repository is located in a directory at `$seastar_dir`.
78 $ g++ my_app.cc $(pkg-config --libs --cflags --static $seastar_dir/build/release/seastar.pc) -o my_app
81 and with CMake using the `Seastar` package:
84 `CMakeLists.txt` for `my_app`:
87 find_package (Seastar REQUIRED)
89 add_executable (my_app
92 target_link_libraries (my_app
97 $ mkdir $my_app_dir/build
98 $ cd $my_app_dir/build
99 $ cmake -DCMAKE_PREFIX_PATH="$seastar_dir/build/release;$seastar_dir/build/release/_cooking/installed" -DCMAKE_MODULE_PATH=$seastar_dir/cmake $my_app_dir
102 The `CMAKE_PREFIX_PATH` values ensure that CMake can locate Seastar and its compiled submodules. The `CMAKE_MODULE_PATH` value ensures that CMake can uses Seastar's CMake scripts for locating its dependencies.
104 Using an installed Seastar
105 --------------------------------
107 You can also consume Seastar after it has been installed to the file-system.
111 - Seastar works with a customized version of DPDK, so by default builds and installs the DPDK submodule to `$build_dir/_cooking/installed`
113 First, configure the installation path:
116 $ ./configure.py --mode=release --prefix=/usr/local
119 then run the `install` target:
122 $ ninja -C build/release install
125 then consume it from `pkg-config`:
128 $ g++ my_app.cc $(pkg-config --libs --cflags --static seastar) -o my_app
131 or consume it with the same `CMakeLists.txt` as before but with a simpler CMake invocation:
137 (If Seastar has not been installed to a "standard" location like `/usr` or `/usr/local`, then you can invoke CMake with `-DCMAKE_PREFIX_PATH=$my_install_root`.)
139 There are also instructions for building on any host that supports [Docker](doc/building-docker.md).
141 Use of the [DPDK](http://dpdk.org) is [optional](doc/building-dpdk.md).
143 #### Seastar's C++ dialect: C++17 or C++20
145 Seastar supports both C++17, and C++20. The build defaults to the latest
146 dialect supported by your compiler, but can be explicitly selected with
147 the `--c++-dialect` configure option, e.g., `--c++-dialect=gnu++17`,
148 or if using CMake directly, by setting on the `Seastar_CXX_DIALECT` CMake
151 See the [compatibity statement](doc/compatibility.md) for more information.
156 There is a [mini tutorial](doc/mini-tutorial.md) and a [more comprehensive one](doc/tutorial.md).
158 The documentation is available on the [web](http://docs.seastar.io/master/index.html).
163 Ask questions and post patches on the development mailing list. Subscription
164 information and archives are available [here](https://groups.google.com/forum/#!forum/seastar-dev),
165 or just send an email to seastar-dev@googlegroups.com.
167 Information can be found on the main [project website](http://seastar.io).
169 File bug reports on the project [issue tracker](https://github.com/scylladb/seastar/issues).
171 The Native TCP/IP Stack
172 -----------------------
174 Seastar comes with its own [userspace TCP/IP stack](doc/native-stack.md) for better performance.
176 Recommended hardware configuration for SeaStar
177 ----------------------------------------------
179 * CPUs - As much as you need. SeaStar is highly friendly for multi-core and NUMA
180 * NICs - As fast as possible, we recommend 10G or 40G cards. It's possible to use
181 1G too but you may be limited by their capacity.
182 In addition, the more hardware queue per cpu the better for SeaStar.
183 Otherwise we have to emulate that in software.
184 * Disks - Fast SSDs with high number of IOPS.
185 * Client machines - Usually a single client machine can't load our servers.
186 Both memaslap (memcached) and WRK (httpd) cannot over load their matching
187 server counter parts. We recommend running the client on different machine
188 than the servers and use several of them.
190 Projects using Seastar
191 ----------------------------------------------
193 * [cpv-cql-driver](https://github.com/cpv-project/cpv-cql-driver): C++ driver for Cassandra/Scylla based on seastar framework
194 * [cpv-framework](https://github.com/cpv-project/cpv-framework): A web framework written in c++ based on seastar framework
195 * [redpanda](https://vectorized.io/): A Kafka replacement for mission critical systems
196 * [Scylla](https://github.com/scylladb/scylla): A fast and reliable NoSQL data store compatible with Cassandra and DynamoDB
197 * [smf](https://github.com/smfrpc/smf): The fastest RPC in the West