473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 1897
In article <11**********************@p79g2000cwp.googlegroups .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
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 >>>...
3
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...
1
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...
0
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...
0
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,...
1
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...
0
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...
45
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...
3
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? ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...

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.