Reputation: 9
I have enabled one Rest service with TLS/SSL. While making calls to one of the APIs, for each request new connection is getting created (Persistent Connection is not working), SSL handshake is happening which is creating a huge impact on the latency. I checked the request headers (from client) and found the Connection: Keep-Alive and Keep-Alive: timeout=10, max=20 are present. I also checked the response(from the server) and didn't find the Connection: Close (also tried to set the Connection and Keep-Alive forcefully), which indicates that server is not closing the connection.But still for every request new connection is getting created.
Client Side Description
Jersey Client + Apache Connector
Server Side Description
Embedded Tomcat
Though at the client side, doing Response.close() (or readEntity) is recommended. But I think It closes the connection so how to use the persistent connections as well as Response.close()/readEntity() at the same time?
Upvotes: 0
Views: 453
Reputation: 1458
The keepalive timeout you have mentioned is 10 milli seconds. Increase it a higher value for example 60,000 for 1 minute.
Hope this Helps!
Regards, Eby
Upvotes: 0