We came across a very similar issue where what we observed was a Spring Boot application, when running as a service was working fine. But when deployed the same as a docker container, became unresponsive after some time, especially when left idle, i.e not used or no API calls made for some time.
What solved it by tuning the TCP keepalive kernel settings on Linux. The internal swarm loadbalancer purges all idle connections after 900 seconds.
So if you set keep alive to something less than 900 seconds, the problem of unresponsiveness will be solved.
1 Like