Networking Forums

Networking Forums > Computer Networking > Linux Networking > Client has to wait long for its answer after many queries served,although server is still fast

Reply
Thread Tools Display Modes

Client has to wait long for its answer after many queries served,although server is still fast

 
 
Holger Bast
Guest
Posts: n/a

 
      12-23-2007, 11:18 PM
Dear all,

I have the following setup (OS is Linux 2.6.16.43.1.amd64-smp, Debian
Sarge):

1. A server written in C++: It waits for a request on a given port
(using accept), reads whatever is sent (using read), computes an
answer string, sends it back (using write), then closes the connection
(using close).

2. A client written in PHP: It opens the connection (using fsockopen),
sends the request string (using fwrite), reads the data (using fgets),
then closes the connection (using fclose).

Queries come in at an average rate of about one query per second. The
server needs a few milliseconds to compute the answer string

The whole thing works fine for the first, say, 10,000 queries.

Then, for some reason that I don't understand, it happens more and
more often that the client has to wait several hundred milliseconds
before it receives the first data.

Everything is still fine on the server side: computing and sending
still just takes a few milliseconds.

When I restart the server everything is back to normal again. The
phenomenon also happens when only few queries have been processed, but
rarely. After the aforementioned 10,000 queries it becomes the rule
rather than the exception, but there are still queries for which
everything is fine then.

Any ideas what might be happening here?

thanks for your help,

Holger

 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a

 
      12-27-2007, 05:16 AM
On Dec 23, 4:18 pm, Holger Bast <bast.hol...@googlemail.com> wrote:

> Then, for some reason that I don't understand, it happens more and
> more often that the client has to wait several hundred milliseconds
> before it receives the first data.


Did you 100% confirm that this delay is *after* it sends the data but
*before* it receives it? Or are you just guessing that the delay is
waiting to receive data?

DS
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Long wait for log on Darrell Martin Windows Networking 3 06-07-2005 01:51 AM
Long Wait for Log On Darrell Martin Windows Networking 3 05-27-2005 03:07 PM
How long can BT make me wait? DeeBee Broadband 6 11-19-2004 07:59 PM
how long to wait for activation-date ? Mike Broadband 8 02-26-2004 09:26 AM
Long wait for domain to be available Al Neely Windows Networking 3 09-25-2003 05:47 AM



1 2 3 4 5 6 7 8 9 10 11