Hello,

Thanks, it seems to work. Keep-Alive = 10 seconds.

First request (creates new connection)

Get connection: HttpRoute[{}->http://10.20.30.105:80], timeout = 1
[HttpRoute[{}->http://10.20.30.105:80]] kept alive: 0, issued: 0, allocated:
0 out of 500
No free connections [HttpRoute[{}->http://10.20.30.105:80]][null]
Available capacity: 2147483647 out of 2147483647
[HttpRoute[{}->http://10.20.30.105:80]][null]
Creating new connection [HttpRoute[{}->http://10.20.30.105:80]]
Attempt 1 to execute request
Sending request: POST /wsserhs/rhodasol?a=1 HTTP/1.1
Receiving response: HTTP/1.1 200 OK
Connection can be kept alive for 10000 ms
Released connection is reusable.
Releasing connection [HttpRoute[{}->http://10.20.30.105:80]][null]
Pooling connection [HttpRoute[{}->http://10.20.30.105:80]][null]; keep alive
for 10000 MILLISECONDS
Adding connection at: 1301590475036
Notifying no-one, there are no waiting threads


Second request (takes previous connection from pool)

Get connection: HttpRoute[{}->http://10.20.30.105:80], timeout = 1
[HttpRoute[{}->http://10.20.30.105:80]] kept alive: 1, issued: 0, allocated:
1 out of 500
Getting free connection [HttpRoute[{}->http://10.20.30.105:80]][null]
Attempt 1 to execute request
Sending request: POST /wsserhs/rhodasol?a=1 HTTP/1.1
Receiving response: HTTP/1.1 200 OK
Connection can be kept alive for 10000 ms
Released connection is reusable.
Releasing connection [HttpRoute[{}->http://10.20.30.105:80]][null]
Pooling connection [HttpRoute[{}->http://10.20.30.105:80]][null]; keep alive
for 10000 MILLISECONDS
Adding connection at: 1301590476953
Notifying no-one, there are no waiting threads


Third request, after waiting more than 10 seconds (takes previous connection
from pool, but it's not alive --> close and create a new one)

Get connection: HttpRoute[{}->http://10.20.30.105:80], timeout = 1
[HttpRoute[{}->http://10.20.30.105:80]] kept alive: 1, issued: 0, allocated:
1 out of 500
Getting free connection [HttpRoute[{}->http://10.20.30.105:80]][null]
Closing expired free connection
[HttpRoute[{}->http://10.20.30.105:80]][null]
Connection closed
No free connections [HttpRoute[{}->http://10.20.30.105:80]][null]
Available capacity: 2147483647 out of 2147483647
[HttpRoute[{}->http://10.20.30.105:80]][null]
Creating new connection [HttpRoute[{}->http://10.20.30.105:80]]
Attempt 1 to execute request
Sending request: POST /wsserhs/rhodasol?a=1 HTTP/1.1
Receiving response: HTTP/1.1 200 OK
Connection can be kept alive for 10000 ms
Released connection is reusable.
Releasing connection [HttpRoute[{}->http://10.20.30.105:80]][null]
Pooling connection [HttpRoute[{}->http://10.20.30.105:80]][null]; keep alive
for 10000 MILLISECONDS
Adding connection at: 1301590655288
Notifying no-one, there are no waiting threads




-----Mensaje original-----
De: Sam Crawford [mailto:samcrawf...@gmail.com] 
Enviado el: jueves, 31 de marzo de 2011 18:18
Para: HttpClient User Discussion
CC: Joan Balaguero
Asunto: Re: Keep alive

You can increase the logging level as per the "Enable context logging
for connection management / request execution" instructions listed on
http://hc.apache.org/httpcomponents-client-ga/logging.html

Alternatively, you could use tcpdump or Wireshark to capture the
packets and see if the same TCP connection is being re-used.

Thanks,

Sam



On 31 March 2011 17:12, Joan Balaguero <joan.balagu...@grupoventus.com>
wrote:
> Hello Oleg,
>
>
>
> I’ve implemented a Connection Keep Alive strategy in my app, but I’m not
> able to see what is the better way to check if it’s working ok. Could you
> give any clue about how to do this?
>
>
>
> Thanks,
>
> Joan.
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to