[Twisted-Python] twisted and performance

weiwei weiwei waterinfire at hotmail.com
Wed Jun 13 20:11:54 MDT 2007


Hi,all!



         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 
socket.



Our design is : reactor + adbapi.ConnectionPool

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

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! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





More information about the Twisted-Python mailing list