Recommended Container/POD CPU size for a SpringBoot and Vert.X application on OpenShift

6/5/2018

We use OpenShift 3.6 as our Cloud PaaS, I'm testing out Spring Boot and Vert.X applications that connect to Couchbase Cluster. The default POD sizes that are available are 250millicore X 1 GB, 400millicore X 1.5 GB and 1core X 3 GB.

When I try to deploy the applications (Spring Boot / Vert.X) I observe bootstrap times of > 2-3 minutes in the 250millicore POD vs 45 seconds on 1Core POD. Consequently the Couchbase bootstrap is taking a lot of time on the 250millicore POD which is breaching its default Connect Timeouts and is crashing the application.

If I increase the timeouts, the app starts however it is sluggish when ever any transactions are performed. I could use the 1 X 3 POD but there is an increased cost involved to it. I however dont seem to have any problem with memory used.

Q1) What is the CPU dependency of the JVM during the startup (spinning new threads, processing in-memory, classloading etc.).

Q2) I know that JVM is resource intensive during startup but is there a minimum recommended POD size for the stack in use on which the app performs decently.

Q3) If a higher POD size is a default requirement of a Java app/JVM, doesn't it defy the concept of being able to use it as a micro-service which should be lightweight.

I have tweaked around with the JVM parameters, Xmx, Xms and different combinations of GC like the G1GC, ParallelGc etc (to see if it might play out differently) but keep experiencing the same bootstrap times. The only thing that seem to have an effect is the CPU size.

Spring boot v2.1 OpenShift v3.6 Couchbase v5.1 Java v1.8.161 CB SDK 2.5.7

Attached is a VisualVM snapshot of the app on my local machine (i5 - 4 core) This seem to taking around 30% of CPU capacity during the initial period of the app life-cycle.

-- Abhishek Ambatipudi
docker
java
jvm
kubernetes
openshift

0 Answers