Spring REST - after longer idle time, first calls take very long time (5-10 seconds)

We run microservices on spring boot (with embedded tomcat) and spring cloud. This means service discovery, regular health checks, and services that respond to those health checks, ... We also have a spring boot server to monitor, and we can see that all services are running fine. Currently only works in test environment ...

Some of our microservices are rarely named (say, once every two days), but there are regular health checks. When the REST api of these services is called after such a long idle time, the first request takes a very long time to process. This of course causes the circuit breakers to open in the request and error chains ... I also see this behavior when calling different endpoints using the spring boot admin (Theads list, Metrics).

As a summary, I've seen this behavior on spring boot data calls admim, thread information, environment information, or calls where the database is called using a Hikari datasource, or where aservice was trying to send email via smtp server

My questions are: Is this related to the embedded server and thread pool setup? Or should I dive deep into other thread pools and connection pools affected by these requests? Any ideas for diagnostics?

Many thanks

+3


source to share





All Articles