473,756 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange i/o delay problem in socket,

Hi guys,
I have got some strange system behaviors regarding i/o delays in socket
in python, here's the details:
I'm writing a web proxy like program that intercepts and redirects
requests from clients to my tomcat server,
this proxy is written in python, and i'm starting a new thread to
handle (redirect) the requests whenever there's a new client connected
to my proxy. Each handler thread will read the http request line from
the client first, do some processing, and then redirect it to the
tomcat, and here's the problem:

while in most cases, the time needed for a handler thread to read the
request line from the socket is below 1 millisecond, there are some
cases this time is over severl thousand (or even higher) milliseconds.
I'm just wondering what could be the possible cause(s) of this ? btw,
this happens more often when there are large number of clients, but
will also happen ocassionally when the number of client is very
small....

i've heard of something reagarding python's relative low i/o
performance, but not sure whether or not this problem is a python
specific one...or is it a bug? someone please enlighten me
thanks

Fred

Jul 6 '06 #1
1 1924
In article <11************ **********@p79g 2000cwp.googleg roups.com>,
"li******@gmail .com" <li******@gmail .comwrote:
>while in most cases, the time needed for a handler thread to read the
request line from the socket is below 1 millisecond, there are some
cases this time is over severl thousand (or even higher) milliseconds.
I'm just wondering what could be the possible cause(s) of this ? btw,
this happens more often when there are large number of clients, but
will also happen ocassionally when the number of client is very
small....
It could just be occasional packet loss over your physical network--i.e.
something outside your control.

Not sure how you'd test this, except by running a packet sniffer.
Jul 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3370
by: Jane Austine | last post by:
Running Python 2.3 on Win XP It seems like socket is working interdependently with subprocesses of the process which created socket. ------------------------------------ #the server side >>> import socket >>> s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) >>> s.bind(('localhost',9000))
3
1753
by: FrankEsser | last post by:
Hello! I am not an expert on C++ programming and therefor I have a question: We use a kind of communication server that was written in C++ especially for our company. It just takes incoming socket requests, connects, evaluates incoming data packages and gives them to certain plug-ins adressed in the frame of the data packages. For each data package management an own thread is started. The data packages can arrive faster than the...
1
2905
by: Amadej | last post by:
Hello everyone, I'm having some odd problems with a little program I wrote for sending/receiving bytes across the network. I am using synchronous sockets, and it seems that when I send byte after byte too fast, the packet gets lots somewhere (as odd as that sounds). Here's the sending code:
0
1414
by: Tom Stepka | last post by:
Problem: We are experiencing an excessive (i.e. 16 - 20 seconds) delay when attempting to establish socket connection over the network, using the TcpLister.AcceptSocket() and TcpClient.Connect(ipAddress, Port) calls. It seems that the delay is between client.Connect() and listener.Accept(). We never have a delay when we use a telnet client to connect to the server. And we do not have a delay on all networks, just on some. The code we...
0
1310
by: Paul | last post by:
I'm trying to use a socket connection from within an asp.net application. It works, but somehow opening the socket seems to be extremely slow. It finally connects and you can transfer information, but it hangs for at least 5 seconds before the connection completes. Interestingly, a second connection to the same port in a very short time interval (<1s) returns instantly, but if you wait for a couple of seconds a new connection again takes...
1
2731
by: CKane | last post by:
i am trying to build a "missed message" queue on a C# TCP server. many of the devices connecting are mobile and may drop out in bad signal areas. i want to store any messages missed for when they reconnect. so far....it takes activity on the client end to initialize the close. isnt there a check when the server sends a socket.send to a client that has lost connection? it takes a few minutes for the exception to get hit, and i am losing...
0
298
by: simnav | last post by:
In the following code something strange happens ! If I keep pressed any of ALT+Arrow, keys, they are extracted two times from buffer then getch seems to stop; if I release and press again ALT+arrow nothing changes: the only way to exit from this condition is press another key a single time. What seems to happen is that kbhit say some keys are present in buffer but for getch don't see any data and waits for a key. Why this happen ? If I...
45
3361
by: simnav | last post by:
In the following code something strange happens ! If I keep pressed any of ALT+Arrow, keys, they are extracted two times from buffer then getch seems to stop; if I release and press again ALT+arrow nothing changes: the only way to exit from this condition is press another key a single time. What seems to happen is that kbhit say some keys are present in buffer but for getch don't see any data and waits for a key. Why this happen ? If I...
3
2687
by: Ryan Liu | last post by:
Will TcpClient.GetStream().Read()/ReadByte() block until at least one byte of data can be read? In a Client/Server application, what does it mean at the end of stream/no more data available? Client could send data once few seconds of minutes. Is there an "end" at all? In a C/S application, if server side call BeginginRead() again in EndRead() to create a endless loop to get message from client, is this a better approach than "one...
0
9716
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9716
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6410
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3676
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2542
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.