This procedure outlines how to analyze high CPU utilization in a vprobe container, which is the core component for collecting data from end devices and transmitting it to the OpsRamp cloud.

If a Gateway pod (nextgen-gw) crashes due to high CPU utilization, follow the steps below to debug and resolve the issue.

Step 1: Get the Process ID of the vprobe Container

To get the process ID of the vprobe container, run the following command:

kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c 'ps -ef | grep vprobe'
Sample Responce:
ubuntu@ashok:~$ kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c 'ps -ef | grep vprobe' 
gateway        1       0  0 15:02 ?        00:00:00 /bin/bash /opt/gateway/vprobe/bin/vprobe.sh 
gateway        6       1  6 15:02 ?        00:03:20 java -Djava.naming.provider.url=file:/opt/gateway/vprobe/temp/jndi -Dserver.home= -Dsun.net.inetaddr.ttl=0 -Djava.net.preferIPv4Stack=true -Dhttp.nonProxyHosts=localhost -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2,SSLv3 -Djdk.tls.client.protocols=TLSv1,TLSv1.1,TLSv1.2,SSLv3 --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/sun.security.ssl=ALL-UNNAMED -XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=80 -XX:+ExitOnOutOfMemoryError -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/app/vprobe-jvm-thread.dump -classpath /opt/gateway/vprobe/conf:/opt/gateway/vprobe/lib/:/opt/gateway/vprobe/lib/* com.vistara.gateway.core.VistaraGateway 
gateway     1288       0  0 15:52 pts/0    00:00:00 /bin/bash -c ps -ef | grep vprobe 

Step 2: Get the List of Child Threads for the vprobe Process

To retrieve the list of child threads of the vprobe process, run the following command:

kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c 'top -n 2 -b -H -p <process_id>' > /tmp/child_threads.txt
Example Command:
kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c 'top -n 2 -b -H -p 6' > /tmp/child_threads.txt

Step 3: Generate the Thread Dump for the vprobe Process

To generate a thread dump for the vprobe process, run the following command:

kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c '/jcmd/bin/jstack <process_id> > /tmp/thread_dump.dump'
Example Command:
kubectl exec -it nextgen-gw-0 -c vprobe -- /bin/bash -c '/jcmd/bin/jstack 6 > /tmp/thread_dump.dump'

Step 4: Transfer the Thread Dump from the vprobe Container to the Gateway Node

To transfer the thread dump file from the vprobe container to the gateway node, use the following command:

kubectl cp nextgen-gw-0:<container path> -c vprobe -n default <node path> 
Example Command:
kubectl cp nextgen-gw-0:/tmp/thread_dump.dump -c vprobe -n default /tmp/thread_dump.dump

Step 5: Share the Files with the OpsRamp Support Team

Once you have collected the child threads and thread dump files, share them with the OpsRamp Support Team for further analysis.