www.ShoppingPodder.com

Leading Computer Shopping,
News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

Client has to wait long for its answer after many queries se
   Shopping Podder - the Best of Computer Postings! Forum Index -> Computer - Client-Server  
View previous topic :: View next topic  
Author Message
Holger Bast
Guest






PostPosted: Mon Dec 24, 2007 12:10 am    Post subject: Client has to wait long for its answer after many queries se Reply with quote

Dear all,

I have the following setup:

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
Back to top
Edward Feustel
Guest






PostPosted: Mon Dec 24, 2007 6:25 pm    Post subject: Re: Client has to wait long for its answer after many querie Reply with quote

"Holger Bast" <bast.holger@googlemail.com> wrote in message
news:d323663a-0337-44a6-8206-53fafcc5db6e@e25g2000prg.googlegroups.com...
Quote:
Dear all,

I have the following setup:

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

Virtual Memory Leak?

Paging activity?
Ed
Back to top
Edward Feustel
Guest






PostPosted: Mon Dec 24, 2007 6:25 pm    Post subject: Re: Client has to wait long for its answer after many querie Reply with quote

"Holger Bast" <bast.holger@googlemail.com> wrote in message
news:d323663a-0337-44a6-8206-53fafcc5db6e@e25g2000prg.googlegroups.com...
Quote:
Dear all,

I have the following setup:

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

Virtual Memory Leak?

Paging activity?
Ed
Back to top
suresh shenoy
Guest






PostPosted: Fri Jan 11, 2008 9:36 pm    Post subject: Re: Client has to wait long for its answer after many querie Reply with quote

On Dec 23 2007, 7:10 pm, Holger Bast <bast.hol...@googlemail.com>
wrote:
Quote:
Dear all,

I have the following setup:

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

First thing that comes to mind maybe your not handling memory
correctly. Are you releasing the memory correctly? Post code to better
solve the problem

Suresh Shenoy
Back to top
suresh shenoy
Guest






PostPosted: Fri Jan 11, 2008 9:36 pm    Post subject: Re: Client has to wait long for its answer after many querie Reply with quote

On Dec 23 2007, 7:10 pm, Holger Bast <bast.hol...@googlemail.com>
wrote:
Quote:
Dear all,

I have the following setup:

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

First thing that comes to mind maybe your not handling memory
correctly. Are you releasing the memory correctly? Post code to better
solve the problem

Suresh Shenoy
Back to top
Display posts from previous:   
   Shopping Podder - the Best of Computer Postings! Forum Index -> Computer - Client-Server  
Page 1 of 1
All times are GMT

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum