Spring Boot & kubernetes JVM can not go over 1 CPU

Viewed 66

After deploying my spring boot application (2.7.3), with the following configuration:

  • CPU req: 1.2
  • CPU limit: no limit
  • image: "gcr.io/distroless/java17:nonroot"
  • JAVA_TOOL_OPTIONS: "-XX:MinRAMPercentage=60.0 -XX:MaxRAMPercentage=75.0"
  • GKE 1.21.11-gke.1900 with cos_containerd

it seems that under heavy load my system can not go over 1 CPU usage as seen in the following picture:

enter image description here

Anyone have faced similar situation ?

2 Answers

Your application process may be single threaded? If not, try to add JVM options -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal and check in the standard output for CPU related values like ActiveProcessorCount.

Find out that the micrometer metrics are actually used as % of usage, which mean it actually work as expected.

Related