we have noticed too high response time in the very first minute after a newly created Gateway pod starts handling the traffic.
Later on, the Gateway responds usually with less latency.
11.1
A few recommendations are made based on VM's JVM suggestions and the nature of the observed delay (around 8 seconds).
The following JVM options can help reduce allocation pauses during startup and make memory handling more predictable in containerized environments:
-XX:+UseG1GC
-XX:NewRatio=1
-XX:SurvivorRatio=6
-XX:+AlwaysPreTouch
-XX:+ParallelRefProcEnabled
-XX:+ExplicitGCInvokesConcurrent
-XX:+TieredCompilation
-XX:+AlwaysCompileLoopMethods
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=75.0
-XX:InitialRAMPercentage=75.0
AlwaysPreTouch ensures memory is committed up front to avoid paging delays.NewRatio and SurvivorRatio enlarge the young generation and survivor space, helping with the burst of allocations when the pod first handles traffic.ParallelRefProcEnabled and ExplicitGCInvokesConcurrent reduce stop-the-world collection risks.TieredCompilation and AlwaysCompileLoopMethods speed up JIT compilation of frequently used methods.These flags should reduce GC-related interruptions during startup, though the ~8 second latency is more likely related to JVM JIT warm-up and classloading.
To ensure traffic is only routed to the pod once Tomcat and the JVM are fully warmed up, we recommend using an application-level readiness probe instead of the current command-based script. Example:
readinessProbe: httpGet: path: /ssg/ping # Replace with your service’s health/status endpoint port: 8443 scheme: HTTPS initialDelaySeconds: 30 # Allow JVM/Tomcat to finish initialization periodSeconds: 10 # Probe interval timeoutSeconds: 5 # Allow a few seconds for the service to respond successThreshold: 1 failureThreshold: 3