On 2/16/20 8:43 AM, Bo Lorentsen wrote:
Hi ...

Thanks for all your valuable input, I found the error at last, and the new version in my git spike is working as it should.

The problem was starvation of my events and backlog overrun as a consequence, when the number of connections came in really fast, it also added protocol handlers really fast. When the accept loop was finished all these new handlers was busy handling incoming connection events, as expected.

Even though each protocol handler did not do much while handling incoming data, except setting up callbacks for new protocols and handling raw request parsing, many of these protocol handlers starved a bit as a result. This was not a big problem, but the accept event was really sensible to this, as its backlog ended up getting filled up while it was waiting (and ab opened new ones really fast).

I have now made the accept event priority 1 (default is 0 as I understand it), and the accept loop handles max half of the backlog size, before releasing the event in order to make the rest of the events possible.

I now have as good performance (38k/s with keep alive, 16k/s for plain 1.0 on my laptop), and no errors !

At least I learned a lot :-)

/BL

Thanks for reading so far

Regards

/BL



_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/libev

Reply via email to