Reputation: 5952
I use Jersey Client 2.9. I observed that if I send one post request to the jersey server, it takes around 300 miliseconds. Jersey server also resides in localhost. If I send many requests one after another, then the last communication time gap is around 10 millisecond. In other words, the time gap gets reduced.
Any one know why happens this and any way to reduce jersey client server connection latency?
Upvotes: 0
Views: 213
Reputation: 1139
When you send only a single request, a new TCP connection has to be setup between the client and server. For subsequent requests, the connection is reused and with it the latency comes down.
Upvotes: 1