By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

strange i/o delay problem in socket,

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.