0

We have a windows client sending requests to a web service through a tomcat server. However some of the requests are getting stuck and taking 17 mins to come through whereas the usual request time is a second.

While analysing the web service logs I can see that for requests that get stuck, the header of the previous request is missing the connection:keep alive bit.

Which kind of means that since the connection isn't alive, the whole TCP channel needs to be established causing the 17 min delay?

But what causes the 'connection: keep alive' to go missing?

It's pretty random, like 1 or 2 requests having this issue out of 30 odd requests.

I checked the server.xml file but can't find any respective parameters there.

We are using HTTP/1.1

Any help will be appreciated.

Thanks, Taps

Taps
  • 1
  • Very probably you are looking at the wrong place. The Keep-Alive HTTP header is mostly used for HTTP 1.0 clients/servers to maintain the TCP connection, while it is the default behaviour with HTTP 1.1 clients/servers. If your application takes 17 minutes to answer, you should investigate for any deadlock (thread-dumps are usefull) and try to find why or when it's happening (does it happen if only one user is connected ?) – Eugène Adell May 14 '19 at 08:08
  • Hello Eugene, Thanks for your reply. the issue is pretty random. Can you please guide me how to investigate for deadlocks using thread dumps? I can see jstack is one such tool.... – Taps May 16 '19 at 02:27
  • it's a difficult topic if you are starting from the beginning. You can use jvisualvm to monitor threads and find one which is executing for a long time but it needs you to stay in front of your screen until the problem happens. A thread-dump is a kill -3 sent to the process (in Linux) and then you need to check its output. Maybe, have a look at this [answer](https://stackoverflow.com/a/12277128/7748072) – Eugène Adell May 16 '19 at 05:55

0 Answers0