[Twisted-Python] twisted profiling help

glyph at divmod.com glyph at divmod.com
Thu Jun 2 18:11:10 EDT 2005



On Thu, 2 Jun 2005 17:11:27 -0400 (EDT), Yun Mao <maoy at cis.upenn.edu> wrote:
>
>On Thu, 2 Jun 2005, James Y Knight wrote:
>>
>>On Jun 2, 2005, at 3:17 PM, Yun Mao wrote:
>>>Part of my profiling result of a high speed transfer test is attached.
>>>What might that <string>:1(connect_ex) be? I only created 2 or 3 TCP 
>>>connections, but there are 24655 calls.
>>
>><string>:1(connect_ex) is part of the utterly stupid wrapper object that 
>>python has in socket.py around the real _socket module. Either you have a 
>>client that has tried to connect 24655 times, or the profiler is lying to 
>>you.
>
>If I had a client doing that, I should have had connectTCP or other similar 
>methods called 24655 times (or close) too, right?

Do not underestimate the probability that the profiler is lying: Python's dev tools (profiler, debugger, etc) are all pretty buggy.

However, it is also possible that connect() is busy but the FD is showing up as readable anyway, and thus for some absurd number of mainloop iterations (until it ACTUALLY completes and is therefore finished connecting) the reactor runs .connect().

Is this on Windows by any chance?




More information about the Twisted-Python mailing list