All Projects → scylladb → Seastar

scylladb / Seastar

Licence: apache-2.0
High performance server-side application framework

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to Seastar

Ratchet
Asynchronous WebSocket server
Stars: ✭ 5,596 (-11.57%)
Mutual labels:  async
Async Http Client
Asynchronous Http and WebSocket Client library for Java
Stars: ✭ 5,876 (-7.14%)
Mutual labels:  async
Asyncawaitbestpractices
Extensions for System.Threading.Tasks.Task and System.Threading.Tasks.ValueTask
Stars: ✭ 693 (-89.05%)
Mutual labels:  async
A Tale Of Three Lists
Comparing various async patterns for a single demo
Stars: ✭ 639 (-89.9%)
Mutual labels:  async
Kovenant
Kovenant. Promises for Kotlin.
Stars: ✭ 657 (-89.62%)
Mutual labels:  async
G3log
G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own. G3log is made with plain C++14 (C++11 support up to release 1.3.2) with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros. See Readme below for details of usage.
Stars: ✭ 677 (-89.3%)
Mutual labels:  async
Starlette
The little ASGI framework that shines. 🌟
Stars: ✭ 6,337 (+0.14%)
Mutual labels:  async
Prologue
Prologue is an elegant web framework written in Nim.
Stars: ✭ 700 (-88.94%)
Mutual labels:  async
Reservoir
Android library to easily serialize and cache your objects to disk using key/value pairs.
Stars: ✭ 674 (-89.35%)
Mutual labels:  async
Vertx Sql Client
High performance reactive SQL Client written in Java
Stars: ✭ 690 (-89.1%)
Mutual labels:  async
P Map
Map over promises concurrently
Stars: ✭ 639 (-89.9%)
Mutual labels:  async
Continuable
C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)
Stars: ✭ 655 (-89.65%)
Mutual labels:  async
Rawrabbit
A modern .NET framework for communication over RabbitMq
Stars: ✭ 682 (-89.22%)
Mutual labels:  async
Android Startup
🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.
Stars: ✭ 635 (-89.97%)
Mutual labels:  async
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (-89.02%)
Mutual labels:  async
Micro Router
🚉 A tiny and functional router for Zeit's Micro
Stars: ✭ 621 (-90.19%)
Mutual labels:  async
Vibora
Fast, asynchronous and elegant Python web framework.
Stars: ✭ 5,734 (-9.39%)
Mutual labels:  async
Awaitkit
The ES8 Async/Await control flow for Swift
Stars: ✭ 709 (-88.8%)
Mutual labels:  async
Async
Async utilities for node and the browser
Stars: ✭ 27,391 (+332.85%)
Mutual labels:  async
Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (-89.1%)
Mutual labels:  async

Seastar

CircleCI Version License: Apache2 n00b issues

Introduction

SeaStar is an event-driven framework allowing you to write non-blocking, asynchronous code in a relatively straightforward manner (once understood). It is based on futures.

Building Seastar

For more details and alternative work-flows, read HACKING.md.

Assuming that you would like to use system packages (RPMs or DEBs) for Seastar's dependencies, first install them:

$ sudo ./install-dependencies.sh

then configure (in "release" mode):

$ ./configure.py --mode=release

then compile:

$ ninja -C build/release

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.

For example, to fetch fmt locally, configure Seastar like this:

$ ./configure.py --mode=dev --cook fmt

--cook can be repeated many times for selecting multiple dependencies.

Build modes

The configure.py script is a wrapper around cmake. The --mode argument maps to CMAKE_BUILD_TYPE, and supports the following modes

CMake mode Debug info Optimi­zations Sanitizers Allocator Checks Use for
debug Debug Yes -O0 ASAN, UBSAN System All gdb
release RelWithDebInfo Yes -O3 None Seastar Asserts production
dev Dev (Custom) No -O1 None Seastar Asserts build and test cycle
sanitize Sanitize (Custom) Yes -Os ASAN, UBSAN System All second level of tests, track down bugs

Note that seastar is more sensitive to allocators and optimizations than usual. A quick rule of the thumb of the relative performances is that release is 2 times faster than dev, 150 times faster than sanitize and 300 times faster than debug.

Using Seastar from its build directory (without installation)

It's possible to consume Seastar directly from its build directory with CMake or pkg-config.

We'll assume that the Seastar repository is located in a directory at $seastar_dir.

Via pkg-config:

$ g++ my_app.cc $(pkg-config --libs --cflags --static $seastar_dir/build/release/seastar.pc) -o my_app

and with CMake using the Seastar package:

CMakeLists.txt for my_app:

find_package (Seastar REQUIRED)

add_executable (my_app
  my_app.cc)
  
target_link_libraries (my_app
  Seastar::seastar)
$ mkdir $my_app_dir/build
$ cd $my_app_dir/build
$ cmake -DCMAKE_PREFIX_PATH="$seastar_dir/build/release;$seastar_dir/build/release/_cooking/installed" -DCMAKE_MODULE_PATH=$seastar_dir/cmake $my_app_dir

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.

Using an installed Seastar

You can also consume Seastar after it has been installed to the file-system.

Important:

  • Seastar works with a customized version of DPDK, so by default builds and installs the DPDK submodule to $build_dir/_cooking/installed

First, configure the installation path:

$ ./configure.py --mode=release --prefix=/usr/local

then run the install target:

$ ninja -C build/release install

then consume it from pkg-config:

$ g++ my_app.cc $(pkg-config --libs --cflags --static seastar) -o my_app

or consume it with the same CMakeLists.txt as before but with a simpler CMake invocation:

$ cmake ..

(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.)

There are also instructions for building on any host that supports Docker.

Use of the DPDK is optional.

Seastar's C++ dialect: C++17 or C++20

Seastar supports both C++17, and C++20. The build defaults to the latest dialect supported by your compiler, but can be explicitly selected with the --c++-dialect configure option, e.g., --c++-dialect=gnu++17, or if using CMake directly, by setting on the Seastar_CXX_DIALECT CMake variable.

See the compatibity statement for more information.

Getting started

There is a mini tutorial and a more comprehensive one.

The documentation is available on the web.

Resources

Ask questions and post patches on the development mailing list. Subscription information and archives are available here, or just send an email to [email protected].

Information can be found on the main project website.

File bug reports on the project issue tracker.

The Native TCP/IP Stack

Seastar comes with its own userspace TCP/IP stack for better performance.

Recommended hardware configuration for SeaStar

  • CPUs - As much as you need. SeaStar is highly friendly for multi-core and NUMA
  • NICs - As fast as possible, we recommend 10G or 40G cards. It's possible to use 1G too but you may be limited by their capacity. In addition, the more hardware queue per cpu the better for SeaStar. Otherwise we have to emulate that in software.
  • Disks - Fast SSDs with high number of IOPS.
  • Client machines - Usually a single client machine can't load our servers. Both memaslap (memcached) and WRK (httpd) cannot over load their matching server counter parts. We recommend running the client on different machine than the servers and use several of them.

Projects using Seastar

  • cpv-cql-driver: C++ driver for Cassandra/Scylla based on seastar framework
  • cpv-framework: A web framework written in c++ based on seastar framework
  • redpanda: A Kafka replacement for mission critical systems
  • Scylla: A fast and reliable NoSQL data store compatible with Cassandra and DynamoDB
  • smf: The fastest RPC in the West
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].