id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,branch,branch_author,launchpad_bug
3290,Epoll reactor pauses for 10-15 seconds during high connection volume,kvogt,,"I've included sample code below.  

Basically, when you flood the reactor with a couple thousand connections, the strace shows that the process blocks on epoll for 10-15 seconds.  Some connections eventually time out instead of being accept()'d by the reactor.

Make sure you have lots of fd's handy:

# ulimit -n 65536

Run the attached snippet with:

# twistd --python test.py --reactor epoll

Then test with:

# ab -c10000 -n10000 http://127.0.0.1/2000/bench

And tail the log:

# tail -f twistd.log",defect,new,normal,,core,,epoll,exarkun,,,
