Message26257
I have tested a socket client script on two versions of
RedHat/Python and the later version is slow to execute
the initial recv(). In each test the client script was
identical and the server end was the same Windows
XML-ODBC service. The code and strace below shows
an initial recv taking 0.09 secs and 4.5 secs respectively.
The tests are repeatable with similar results each time.
Should I expect this kind of effect as software evolves or
is there a solution? Could it be internetwork latency as
the clients tests were run on hosts in different locations?
-------------
import socket
host = "xx.xx.xx.xx"
port = xxxx
DSN = "xxxx;UID=xxxx;"
length = 1024
Request = '''xxxxxxx'''
socket = socket.socket(socket.AF_INET,
socket.SOCK_STREAM)
socket.connect((host,port))
XML = ''
EOM = '</Result>'
bytecount = socket.send(Request)
while XML[-10:-1] != EOM:
XML += socket.recv(length)
socket.close()
------------------------------------------------------
strace results on client script run from command line:
1. RedHat Enterprise Linux 3 ES
Python 2.2.3 (#1, Aug 8 2003, 08:44:02)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)] on linux2
[pid 14467] socket(PF_INET, SOCK_STREAM,
IPPROTO_IP) = 3 <0.000028>
[pid 14467] rt_sigaction(SIGPIPE, {SIG_IGN},
{SIG_IGN}, 8) = 0 <0.000016>
[pid 14467] connect(3, {sa_family=AF_INET,
sin_port=htons(xxxx), sin_addr=inet_addr("xx.xx.xx")},
16) = 0 <0.017305>
[pid 14467] send(3, "<?xml version=\"1.0\"?
>\r\n\t\t<Reques"..., 287, 0) = 287 <0.000025>
[pid 14467] recv(3, "<?xml version=\"1.0\"
encoding=\"UT"..., 1024, 0) = 40 <0.093178>
[pid 14467] recv(3, "<!--\r\n Generated by Easysoft
XM"..., 1024, 0) = 378 <0.019240>
[pid 14467] close(3) = 0 <0.000027>
2. RedHat Enterprise Linux 4 ES
Python 2.3.4 (#1, Feb 2 2005, 11:44:49)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
[pid 11072] socket(PF_INET, SOCK_STREAM,
IPPROTO_IP) = 3 <0.000039>
[pid 11072] rt_sigaction(SIGPIPE, {SIG_IGN},
{SIG_IGN}, 8) = 0 <0.000011>
[pid 11072] connect(3, {sa_family=AF_INET,
sin_port=htons(xxxx), sin_addr=inet_addr
("xx.xx.xx.xx")}, 16) = 0 <0.016039>
[pid 11072] send(3, "<?xml version=\"1.0\"?
>\r\n\t\t<Reques"..., 287, 0) = 287 <0.000021>
[pid 11072] recv(3, "<?xml version=\"1.0\"
encoding=\"UT"..., 1024, 0) = 40 <4.539525>
[pid 11072] recv(3, "<!--\r\n Generated by Easysoft
XM"..., 1024, 0) = 378 <0.019317>
[pid 11072] close(3) = 0 <0.000069>
|
|
Date |
User |
Action |
Args |
2007-08-23 14:34:27 | admin | link | issue1285940 messages |
2007-08-23 14:34:27 | admin | create | |
|