We have our project hosted in OpenShift (OKD to be precise. We host it ourselves). The setup is as follows:
Routing server (Spring Boot 1.5.8 with Zuul): This one takes all the incoming traffic and routes it to the correct services
Multiple services (all with Spring Boot): Here is all the business logic
We use SOAP for calling other services in this project.
Currently, when we call the application, the call goes to the routing server, which then routes it to the main business service.
After a short inactivity of about one hour, our main business service is not reachable via the external call. The edge server however is available and callable 100% of the time. We do get a 504 Gateway Timeout exception from the system when we call it. We already figured out that this is the timeout of the route in openshift (haproxy.router.openshift.io/timeout in the route).
The core problem is, that OpenShift seems to hibernate the main business service after an inactivity of about one hour. After a delay of 15 minutes however the calls seem to find their destination and the data gets processed correctly.
How can we turn this behaviour off?
Our pod config (some names are anonymized):
https://gist.github.com/moritzluedtke/6867499b0acbb2d7b5a9a70e49b0d45c
We do not use autoscaler.
Our deployment configs (some names are anonymized):
https://gist.github.com/moritzluedtke/dc7c1078fe9cc7e4aeb737094849fc1b
OpenShift Master: v3.11.0+1c3e643-87
Kubernetes Master: v1.11.0+d4cacc0
OpenShift Web Console: v3.11.0+ea42280
It seems that this is not a problem with OpenShift but rather our tech stack. I will update this question, as soon as we have a solution.
We ended up updating the database driver (POSTGRESQL) and switching out the default connection pool from spring.
pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>${HikariCP.version}</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With