Fast asyncio and uvloop-replacement for Linux servers using multiprocess epoll and shared memory
Project description
Description
Fast epoll server for Python3 (asyncio and uvloop server replacement) w/ Linux and TCP-support only (for now). Main feature: It is able to handle more than 1M requests per second on regular physical hardware (e.g. a $1k laptop with an Intel Core Ultra 7 155H).
HTTP benchmarks
Hardware: laptop on a 50% underclocked Intel Core Ultra 7 with 22 CPU threads. Tools used: wrk with the parameters 120 connections over 8 threads for 1s (same results for longer durations).
| Name | Requests per second | Connection type |
|---|---|---|
| Asyncio | 14466 | close |
| Uvloop | 30608 | close |
| Fastepoll | 76072 | close |
| Asyncio | 109428 | keep-alive |
| Uvloop | 134465 | keep-alive |
| Nginx | 347217 | keep-alive |
| Fastepoll | 408639 | keep-alive |
| Fastepoll | 645017 | keep-alive + desync |
| Fastepoll (100% CPU clock) | 1203882 | keep-alive + desync (100% CPU speed) |
Example code
For benchmark code check the /bench directory out. This is just basic sample code.
import fastepoll
class Test:
def connection_made(self, transport):
self.transport = transport
def data_received(self, data):
self.transport.send(b"HTTP/1.0 200 OK\r\n\r\nHello World")
self.transport.close()
def eof_received(self):
pass
fastepoll.run_forever(Test, ":::8080")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastepoll-1.0.1.tar.gz.
File metadata
- Download URL: fastepoll-1.0.1.tar.gz
- Upload date:
- Size: 72.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3e5cc02ad3770badb6b351c955f835c3bbe4d5ebd95437c01e18f27235257f
|
|
| MD5 |
efe2c2c4620237338f8d4e8ce2b1e3f8
|
|
| BLAKE2b-256 |
96179cd34fcbe930a897f6ba885b2621044c01a4eebe20ba311aa598c2107f6c
|
File details
Details for the file fastepoll-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fastepoll-1.0.1-py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
680c73b74df8cbedb5ffbe00c2761e9ce89270cf18c959882576ed4b9f259e9d
|
|
| MD5 |
5de8139f53d7718538dcb4b3f9fa9614
|
|
| BLAKE2b-256 |
cd693f4f62c6748ca4ba4e7091ac5b590cba77d2649da514b9627b6b0a5b9d34
|