[issue3766] socket.socket.recv broken (unbearably slow)

2010-12-31 Thread Konstantin Osipov
Konstantin Osipov kostja.osi...@gmail.com added the comment: I was able to observe the same issue: I'm using Python 2.6.5 on Ubuntu 10.0.4 LTS. My system is 64 bit Intel Core I7, Quad core, Linux kernel 2.6.32-generic x86_64, Ubuntu EGLIBC 2.11.1-0ubuntu7.5. A simple client TCP socket, which

[issue3766] socket.socket.recv broken (unbearably slow)

2009-02-04 Thread Sam
Sam samsli...@gmail.com added the comment: I know this bug is closed, but I too am experiencing it under Linux 2.6.24-22 and Python 2.5.2. I'm using urllib2, and it's just spending an obscene amount of cpu time in {method 'recv' of '_socket.socket' objects} Anyone have any ideas? Would

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-13 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Yes, obviously. Although adding it to the client socket did make no difference after I had already done so for the server. Still communication is too slow by orders of magnitude. (Sorry for pointing this out again) Well, if this precise

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-13 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: -- resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3766 ___ ___

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-12 Thread Thorben
Thorben [EMAIL PROTECTED] added the comment: That's more like it. Now I'd like to see the same behavior on Linux... 2008/9/12 Gabriel Genellina [EMAIL PROTECTED]: Gabriel Genellina [EMAIL PROTECTED] added the comment: I've tested it on Windows XP. MSG_WAITALL is not supported, but I

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' [EMAIL PROTECTED]: -- nosy: +giampaolo.rodola ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3766 ___ ___ Python-bugs-list

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Thorben, is the problem still there if you use fork() rather than launching a separate thread for the server? The implementation of the recv() method is straightforward and I don't see anything that could cause a huge latency there, it's just

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben
Thorben [EMAIL PROTECTED] added the comment: The problem exists even if the server part is replaced by a server written in C. I only wrote up the dummy server in python to be able to provide a testcase. The C server works with reasonable speed when connected to a client written in perl by the

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: You can use setsockopt() to set the TCP_NODELAY flag and see if that improves things; sending thousands of 4-bytes packets isn't exactly the expected utilization of TCP. As I said, socket.recv() is just a thin wrapper above the same-named C

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben
Thorben [EMAIL PROTECTED] added the comment: 2008/9/11 Antoine Pitrou [EMAIL PROTECTED]: Antoine Pitrou [EMAIL PROTECTED] added the comment: You can use setsockopt() to set the TCP_NODELAY flag and see if that improves things; sending thousands of 4-bytes packets isn't exactly the expected

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: now thats interesting: adding the line sock.setsockopt(SOL_TCP, TCP_NODELAY, 1) decreased the delay by half. It still is extremely high but it's a start. Did you do it on both the client and server sockets? Would be interesting to

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben
Thorben [EMAIL PROTECTED] added the comment: 2008/9/11 Antoine Pitrou [EMAIL PROTECTED]: Antoine Pitrou [EMAIL PROTECTED] added the comment: now thats interesting: adding the line sock.setsockopt(SOL_TCP, TCP_NODELAY, 1) decreased the delay by half. It still is extremely high but it's a

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Gabriel Genellina
Gabriel Genellina [EMAIL PROTECTED] added the comment: I've tested it on Windows XP. MSG_WAITALL is not supported, but I replaced it using a while loop. I didn't notice any extraneous delay. 500 packets @ 2 tokens each (500 very short lists) 0.140999794006 16008 function calls in

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-10 Thread Thorben Krueger
Thorben Krueger [EMAIL PROTECTED] added the comment: As promised, here is the profiler output for a Mac (thanks Stefan). The problem does NOT occur here, which should help greatly in tracking down the cause in the socket library. Anyone into this? $ python runme.py 500 packets @ 2 tokens each

[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-03 Thread Thorben Krueger
New submission from Thorben Krueger [EMAIL PROTECTED]: Under Linux 2.6.24-1-amd64 as well as 2.6.26 (x86-32), Python versions 2.5.2 and 2.4.4 (on both machines), there is a huge discrepancy between socket read latencies, depending on code context. Some detail: For a university project, I wrote