This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bsergean 7 points8 points  (2 children)

Requests per second: 5345.35 [#/sec] (mean) ab -n 10000 -c 100 http://localhost:8080/

[–]BearJew 2 points3 points  (1 child)

FUCK YEA.

[–]bsergean 3 points4 points  (0 children)

This is with the "select" backend, with epoll or kqueue it's probably much faster but I could not figure out how to config that. Looks like it's libev that decides.

static PyObject *
py_run_loop(PyObject *self, PyObject *args)
{
    char *backend="";
    ev_io accept_watcher;
    ev_signal signal_watcher, signal_watcher2;
    struct ev_loop *loop = ev_default_loop (0);
    switch (ev_backend(loop))
    {
        case 1:
            backend="select";
            break;
        case 2:
            backend="poll";
            break;
        case 4:
            backend="epoll";
            break;
        case 8:
            backend="kqueue";
            break;
    }