Giter VIP home page Giter VIP logo

epoll's Introduction

epoll

MIT license

Epoll examples and benchmarks

Description:

Simple epoll based HTTP servers with constant JSON response to any request.
It's possible to make and run examples on your system as well as in Docker.

To run C version in the Docker container use the next commands:

# cd c/
# docker build -f Dockerfile_C -t epoll .
# docker run --net=host -p 8000:8000 -t epoll

After that you'll see the next output:

Successfully tagged epoll:latest
Server listening on 0.0.0.0:8000

For benchmarks wrk tool was used.

NB: Even with --net=host key in docker run command the performance of examples on a host system is better than in the Docker.

Results:

To test I've used the next wrk confuguration: 2 threads, 100 clients and 10 seconds.
Tested epoll servers were run in Docker, whereas wrk was on the host system (Ubuntu 16.04).

C (threaded_loop (2 threads)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  77176.69

=============================================

CPython3 (multiprocessed_loop (2 processes)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  48215.67

CPython3 (threaded_loop (2 threads)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  29849.85

=============================================

PyPy3 (multiprocessed_loop (2 processes)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  76399.70

PyPy3 (threaded_loop (2 threads)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  74526.86

=============================================

Go (ConcurrentLoop (2 threads)):
$ wrk -t2 -c100 -d10s http://0.0.0.0:8000/
Requests/sec:  76362.73

It's interesting that PyPy3 performance is close to C.

License:

Released under The MIT License.

epoll's People

Contributors

delimitry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hanyunchang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.