[Twisted-Python] twisted and performance

weiwei weiwei waterinfire at hotmail.com
Wed Jun 13 22:11:54 EDT 2007


         Thanks for the python twisted,it is a great software.

         I am from china. This days we use twisted to develop a middleware.

         Requirement is:

1)       Receive:  receive 100~200 different client¡¯s message(they all 
connect to our listen socket) and insert it into database(oracle)

2)       Send: application insert message into db,then our middleware select 
message from database and send this message to its destination through 

Our design is : reactor + adbapi.ConnectionPool

1)       reactor is used in receiveing and sending message from and to 

2)       when we received a message,we use adbapi to insert it to db

3)       we use adbapi to select message from db,and use a Deferred to 
notify us when we got a message from db,and send it to peer,after receiving 
the peer¡¯s acknowledge message ,we update the databse.

After testing many times,we found when the connection number is less than 
20,its performance is very good.But if the connection number is more than 30 
or 50, it is performance is worse and worse.

DO you give me some advice about the design?

Thanks in advance.

Wei wei

Express yourself instantly with MSN Messenger! Download today it's FREE! 

More information about the Twisted-Python mailing list