Profile Image
Taouj Gulla

Application running on K8 pods and having sudden hikes in the CPU usage and the RAM Usage keeps increasing

My Application is running on K8 pods and I see sudden hikes in the CPU usage and the RAM Usage keeps increasing daily by 0.5%.

resources:
  limits:
    cpu: "1000m"
    memory: "2Gi"
  requests:
    cpu: "500m"
    memory: "1.5Gi"

In the attached report the throughput didnt vary, but saw the sudden hike. 

Please advice what I could do to minize the Pause time and catch why there are sudden hikes.



Report URL - https://gceasy.io/my-gc-report.jsp?p=c2hhcmVkLzIwMjEvMDcvMzAvLS1nY3BvcmQubG9nLS0xMi0zNy0xNg==&channel=WEB

  • suddenhikes

  • cpuusage

  • ramusage

  • pausetime

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Taouj!

 

 Greetings.

 

 Your GC behaviour looks normal. From 3:05pm - 3:15pm there is spike in memory consumption. This can cause the CPU spike as well. But it also settles down after 3:15pm.

 

 

Inorder to accurately point the lines of code causing the CPU spike, you need to analyze thread dumps and 'top -H -p {PID}' command output, where {PID} is your Java application's process Id which is experiencing CPU spike. When you issue this ‘top’ command with given arguments, it will list all the threads running in the application and amount of CPU each one of the thread consume. Once you have both the data, you can identify high CPU consuming thread and lines of code they are executing. You can either capture these artifacts and analyze them manually, or use the 14 day trial version of yCrash tool. yCrash tool automatically captures  application-level data (thread dump, heap dump, Garbage Collection log) and system-level data (netstat, vmstat, iostat, top, top -H, dmesg,...). It marries these two datasets and generates an instant root cause analysis report pointing out exact line of code causing the CPU spike. Here is more information on how to diagnose high CPU spike.

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • suddenhikes

  • cpuusage

  • ramusage

  • pausetime