[Twisted-Python] Implementing streaming (broadcast) TCP servers

Adam Atlas adam at atlas.st
Thu Jun 28 16:27:32 EDT 2007


On 28 Jun 2007, at 11.44, Adam Atlas wrote:
> I had similar thoughts... I was thinking, once I had the connection  
> established, I could try to bypass web2's IByteStream stuff and try  
> to use transport.write directly. Do you think that would help? It's  
> less runloopy overhead, at least.

For the record, this seems to be working. I rewrote it to work like  
this, and I was able to pump it up to 64 clients again (me  
broadcasting to the remote server from my own computer, and then  
starting 64 clients on my own computer) but CPU and memory usage were  
much better. CPU was standing around 1.5% and memory around 3.6%. (I  
know these could still be considered SORT OF high, but this is  
actually a vserver where both of these resources are quite limited --  
only 480 MB of the real server's memory.)

However, once all the clients disconnect, the memory doesn't seem to  
go back down to the expected level. Any ideas on where I should start  
looking to solve this?




More information about the Twisted-Python mailing list