All Projects → ymarcov → Chili

ymarcov / Chili

Chili: HTTP Served Hot

Projects that are alternatives of or similar to Chili

Tornado Celery
Non-blocking Celery client for Tornado
Stars: ✭ 561 (+7914.29%)
Mutual labels:  async, asyncio, asynchronous
Aiohttp
Asynchronous HTTP client/server framework for asyncio and Python
Stars: ✭ 11,972 (+170928.57%)
Mutual labels:  async, asyncio, http-server
Peony Twitter
An asynchronous Twitter API client for Python 3.5+
Stars: ✭ 62 (+785.71%)
Mutual labels:  async, asyncio, asynchronous
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (+2000%)
Mutual labels:  async, asyncio, asynchronous
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (+1500%)
Mutual labels:  async, asyncio, asynchronous
Falcon
A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
Stars: ✭ 2,058 (+29300%)
Mutual labels:  async, http-server, asynchronous
Aredis
redis client for Python asyncio (has support for redis server, sentinel and cluster)
Stars: ✭ 576 (+8128.57%)
Mutual labels:  async, asyncio
Yappi
Yet Another Python Profiler, but this time thread&coroutine&greenlet aware.
Stars: ✭ 595 (+8400%)
Mutual labels:  asyncio, asynchronous
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 (+9571.43%)
Mutual labels:  async, asynchronous
Fastapi Users
Ready-to-use and customizable users management for FastAPI
Stars: ✭ 713 (+10085.71%)
Mutual labels:  async, asyncio
Zsh Async
Because your terminal should be able to perform tasks asynchronously without external tools!
Stars: ✭ 528 (+7442.86%)
Mutual labels:  async, asynchronous
Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (+9757.14%)
Mutual labels:  async, asynchronous
Recoil
Asynchronous coroutines for PHP 7.
Stars: ✭ 765 (+10828.57%)
Mutual labels:  async, asynchronous
Vue Loadable
⏳ Improve your loading state control with pretty simple methods and helpers.
Stars: ✭ 23 (+228.57%)
Mutual labels:  async, asynchronous
Reservoir
Android library to easily serialize and cache your objects to disk using key/value pairs.
Stars: ✭ 674 (+9528.57%)
Mutual labels:  async, asynchronous
Cppserver
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 528 (+7442.86%)
Mutual labels:  async, http-server
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (+9828.57%)
Mutual labels:  async, asyncio
Fennel
A task queue library for Python and Redis
Stars: ✭ 24 (+242.86%)
Mutual labels:  async, asyncio
Httpserver
Python 3 implementation of an HTTP server
Stars: ✭ 5 (-28.57%)
Mutual labels:  asyncio, http-server
Async Reduce
Reducer for similar simultaneously coroutines
Stars: ✭ 17 (+142.86%)
Mutual labels:  asyncio, asynchronous

Logo

Embedded HTTP Server / HTTP Middleware

Performance

  • Asynchronous I/O and request processing
  • Offers response caching for added efficiency
  • Autoscaling threadpools: uses less memory when load is light
  • Supports multiple listeners for improved load-distribution
  • Does not overload the CPU or memory when not required

Flexibility

  • File streaming and serving custom streams with async data generation
  • Read/Write throttling, both for the server as a whole and for individual connections
  • Conditional request message body fetching & rejection

User Friendliness

  • Uses modern C++ and is easy to use, and even to customize the code
  • Built-in Profiler to help debug potential performance issues
  • Public API documented with Doxygen

Robustness

  • Thoroughly tested with Google Test unit & integration tests
  • Stress-tested for memory leaks with Valgrind Memcheck
  • Security tested with SlowHTTPTest (DoS simulator)

Example Code (Hello World)

int main() {
    auto endpoint = Chili::IPEndpoint({{127, 0, 0, 1}}, 3000);

    auto handler = Chili::RequestHandler([](Chili::Channel& c) {
        auto& res = c.GetResponse();

        res.AppendHeader("Content-Type", "text/html");
        res.SetContent("<h1>Hello world!</h1>");
        res.SetStatus(Chili::Status::Ok);

        c.SendResponse();
    });

    auto server = Chili::HttpServer(endpoint, handler);

    auto task = server.Start();
    std::cout << "HelloWorld server started!\n";
    task.wait();
}

Getting Started

Install Build Prerequisites

Assuming you're on Ubuntu/Debian,

$ sudo apt-get install cmake libcurl4-gnutls-dev libgtest-dev google-mock libunwind-dev

Compile & Run

$ git clone https://github.com/ymarcov/http
$ cd http
$ git submodule update --init
$ cmake .
$ make hello_world
$ bin/hello_world

Then connect to http://localhost:3000 from your browser.

Documentation (Doxygen)

Documentation may be generated by running doxygen Doxyfile.
After that, it'll be available under doc/html/index.html.

Performance

Running on Intel i7-3630QM (Laptop) @ 2.40GHz with 8GB of memory, here are SIEGE results. In this test, Chili outperformed all other servers, with Lighttpd coming in second. However, keep in mind that those other servers are big, configurable software systems--not simply a library. The test itself was to serve Apache's "It works!" HTML page from each server, as many times as possible, to mainly compare the number of requests served per second.

$ bin/sandbox_echo 3000 4 0 & # Run sandbox server with 4 threads
$ siege -b -c20 -t5S http://localhost:<PORT>

Chili

Transactions: 155471 hits
Availability: 100.00 %
Elapsed time: 4.50 secs
Data transferred: 1586.51 MB
Response time: 0.00 secs
Transaction rate: 34549.11 trans/sec
Throughput: 352.56 MB/sec
Concurrency: 19.30
Successful transactions: 155474
Failed transactions: 0
Longest transaction: 0.01
Shortest transaction: 0.00

Lighttpd 1.4.45

Transactions: 89438 hits
Availability: 100.00 %
Elapsed time: 4.37 secs
Data transferred: 259.38 MB
Response time: 0.00 secs
Transaction rate: 20466.36 trans/sec
Throughput: 59.36 MB/sec
Concurrency: 19.67
Successful transactions: 89439
Failed transactions: 0
Longest transaction: 0.03
Shortest transaction: 0.00

nginx 1.10.3

Transactions: 64993 hits
Availability: 100.00 %
Elapsed time: 4.08 secs
Data transferred: 212.29 MB
Response time: 0.00 secs
Transaction rate: 15929.66 trans/sec
Throughput: 52.03 MB/sec
Concurrency: 19.63
Successful transactions: 64994
Failed transactions: 0
Longest transaction: 0.02
Shortest transaction: 0.00

Apache 2.4.25

Transactions: 27975 hits
Availability: 100.00 %
Elapsed time: 4.40 secs
Data transferred: 81.13 MB
Response time: 0.00 secs
Transaction rate: 6357.95 trans/sec
Throughput: 18.44 MB/sec
Concurrency: 19.74
Successful transactions: 27975
Failed transactions: 0
Longest transaction: 0.68
Shortest transaction: 0.00
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].