strange i/o delay problem in socket,

L

liubojin

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
 
L

Lawrence D'Oliveiro

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top