DISQUS

Third Rail: libevent webserver in 40 lines of c

  • Jerk Face · 1 year ago
    You sure worked hard including evhttp.h which provided all the functionality for you.
  • Arek · 1 year ago
    Hey, I found this page on google just recently and I wanted to add something about libevent, well mainly that 'libev' has been around for a few months now and I think that it has some major advantages over libevent.

    Libev doesn't have a built in webserver, it leaves that to the developer to code , or it can emulate libevent if the libevent httpd server is required. I've written a small server based on 'libev' and compared it to other ones. Take a look :
    http://www.zenebo.com/word/asynchronous-program...

    Feel free to take a look http://software.schmorp.de/pkg/libev.html

    cheers,

    arek bochinski
  • Andrey · 5 months ago
    Thanks a lot Arek!!!
    I'm feed up with libevent its web server is just too slow!! moving on libev now.
  • Steve Dekorte · 1 year ago
    IIRC, the generic_handler function may need a evbuffer_free(buf) call at it's end.
  • Cobru · 7 months ago
    Yes, it does (valgrind reports memory leak in the generic handler).
  • bham · 7 months ago
    OK that's officially slow as hell!

    ab -n 10000 -c 1000 http://localhost/
    ...
    Requests per second: 11222.37 [#/sec] (mean)
    ...

    nginx FTW.
  • social media consultants · 2 weeks ago
    Nice Post I already digged this

    Have a nice day
    marc hames
    ______________________________________________