devxlogo

December 13, 2018

How to troubleshoot CPU problems?

Diagnosing and troubleshooting CPU problems in production that too in cloud environment can become tricky and tedious. Your application might have millions of lines of code, trying to identify exact line of code that is causing the CPU to spike up, might be equivalent of finding needle in the haystack. In this article let???s learn how to find that needle (i.e. CPU spiking line of code) in matter of seconds/minutes. To help readers better understand this troubleshooting technique, we built a sample application and deployed it in to AWS EC2 instance. Once this application was launched it caused CPU consumption to spike up to 199.1%. Now let???s walk you through the steps that we followed to troubleshoot this problem.