Giter Site home page Giter Site logo

mrsndmn / anyevent-http-server-ii Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mons/anyevent-http-server-ii

0.0 1.0 0.0 181 KB

Fast Asynchronous HTTP/1.1 Server

License: Other

Perl 93.16% JavaScript 0.23% Shell 0.80% Python 0.39% Raku 5.41%

anyevent-http-server-ii's Introduction

AnyEvent::HTTP::Server

Fast HTTP/1.1 server component for AnyEvent Framework

There is a previous implementation, that anybody could look to (http://github.com/Mons/AnyEvent-HTTP-Server), but it will never be on CPAN

If you just plan to use something for HTTP, better to look deeper into this version.

If you lack some functionality, please, open ticket or ask me. Maybe it could be easily added.

Rationale

This module is a complete rewrite of previous version. Previous was not so slow, but It will slower than python's Twisted http server or node.js' http server. Also it was much slower than Twiggy.

Current implementation contains no XS and it is faster, than Twiggy with XS HTTP parser. Later I will enhance it with XS.

Warning

This is early development release. I'll try not to change interfaces in major, but some things may be a bit changed

Benchmarks

Benchmarking tool weighttp -c 100 -n 10000 http://localhost:8080/

Example app HTTP server on port 8080, which should reply with string "Good"

All files are located under benchmaks/

  • AnyEvent::HTTP::Server-II (1 worker)

    finished in 1 sec, 295 millisec and 127 microsec, 7721 req/s, 912 kbyte/s

  • AnyEvent::HTTP::Server-II ( 4 workers)

    finished in 0 sec, 552 millisec and 381 microsec, 18103 req/s, 2139 kbyte/s

  • AnyEvent::HTTP::Server (previous)

    finished in 3 sec, 421 millisec and 143 microsec, 2922 req/s, 278 kbyte/s

  • AnyEvent::HTTPD (v0.93t)

    finished in 18 sec, 622 millisec and 941 microsec, 536 req/s, 99 kbyte/s

  • Twiggy (v0.1021)

    finished in 1 sec, 630 millisec and 908 microsec, 6131 req/s, 272 kbyte/s

  • Starman (--workers 1) (v0.3006)

    finished in 2 sec, 469 millisec and 571 microsec, 4049 req/s, 511 kbyte/s

  • Starman (--workers 4) (best for my 4 core)

    finished in 1 sec, 102 millisec and 631 microsec, 9069 req/s, 1161 kbyte/s

  • Pyton Twisted (I'm not a python programmer, so code may be not efficient)

    finished in 4 sec, 122 millisec and 587 microsec, 2425 req/s, 355 kbyte/s

  • Node.js

    finished in 1 sec, 766 millisec and 696 microsec, 5660 req/s, 790 kbyte/s

  • Nginx

      location / { perl 'use nginx; sub { $_[0]->send_http_header(q{text/plain}); $_[0]->print(q{Good}); return OK; }'; }
    

    finished in 0 sec, 290 millisec and 380 microsec, 34437 req/s, 5515 kbyte/s

  • Raw TCP/HTTP server (perl+ev with no logic or parsing)

      For source look into benchmarks/ev-raw.pl
    

    finished in 0 sec, 306 millisec and 259 microsec, 32652 req/s, 2678 kbyte/s

anyevent-http-server-ii's People

Contributors

mons avatar mrsndmn avatar nikolo avatar ochaton avatar tchernicum avatar

Watchers

 avatar

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.