[Twisted-Python] twisted.web and MySQLdb

Eric C. Newton ecn at metaslash.com
Wed Oct 29 05:49:47 MST 2003


I looked into this for a few hours.  I had to build a server that
needed to regularly maintain 20K+ connections.  Of course, I prototyped
it in python first.

It takes a long time just to create and accept 20K+ connections 
in Python.  Epoll wasn't going to help that much.

In the end I wrote it in C++ using ACE.  Since ACE supports poll()
and epoll() event loops, I experimented with both.  I was surprised
that the poll() interface performed nearly as well as epoll() for my
tests.

BTW, if you are going to play around with large numbers of connections,
and you are using Linux, drop the kernel per-connection buffer sizes.

-Eric

On Wed, Oct 29, 2003 at 07:57:58PM +1100, Andrew Bennetts wrote:
> On Tue, Oct 28, 2003 at 11:34:37PM -0800, Nathan Seven wrote:
> > 
> > Speaking of- I know we're kinda tied to Python, but
> > what are the thoughts about using any of the OS's
> > provided event-driven polls? (epoll,kqueue) 
> > I'm guessing these are essentially untouchable without
> > Python mods.
> 
> There's a kqueue reactor already -- see twisted/internet/kqreactor.py (yes,
> it does rely up on an extension module).  I'm not sure how complete it is,
> it's not tested by the buildbot.
> 
> epoll shouldn't be too hard to do with pretty much the same approach.
> Patches accepted :)
> 
> -Andrew.
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list