HTTP Persistent Connections: how to configure time after which client closes connection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP Persistent Connections: how to configure time after which client closes connection

forums
I want to use Persistent HTTP Connections (keep-alive) between a client
appication and glassfish, it can be also https. I want to keep it alive when
its idle for 60 seconds.

I can set connection timeout on glassfish to 60 seconds. I can reuse
connection by sending some subsequent requests.

The problem is that the client closes connection always after 10 seconds when
connection is idle. Next JAX-WS request after 10 seconds goes on new
connection.

Why after 10 seconds? Is it system, java or metry property?

I cant find place where I can configure this timeout.

Thanks for help.

My configuration is Windows XP SP3, metro from java 1.6.0_24-b07.

 


--

[Message sent by forum member 'przemekp']

View Post: http://forums.java.net/node/835561


uri
Reply | Threaded
Open this post in threaded view
|

Re: HTTP Persistent Connections: how to configure time after which client closes connection

uri
This post has NOT been accepted by the mailing list yet.
Hi

I am writing a Web Service client using JAX-WS with Metro 2.3  RI.
My application is Multi Threaded and supposed to endure an heavy load there for I keep the Service (Thread Safe) as a static member and use an Object Pool for the Port objects.
The problem is that whenever I attempt to invoke the externalized web service method, a new connection is being created instead of reuse the active one.
Note that the connection stays established for 10 seconds.
I made sure to use the following VM arguments (-Djava.endorsed.dirs=endorsed -Dhttp.keepAlive=true -Dhttp.maxConnections=20) and verified that the keep alive header is being set as part of the HTTP Request.
I am putting in the endorsed folder all the Metro 2.3 jars (webservices-api.jar, webservices-extra.jar, webservices-extra-api.jar, webservices-rt.jar, webservices-tools.jar) and doing that in order to insure that I operate with the 2.3 version and not with what comes in the JDK. (I am using JDK1.7.0_51 and JRE1.7)

What else should I be doing in order to be able to work with HTTP connection pool (over Metro JAX-WS 2.3)?

Thanks
Uri