0

I have a Java web application running on tomcat 8.5.x on AWS ubuntu ec2 instance.

I was running this application on a m5.xlarge instance which provide 4 vCPU and 16 GB RAM. On this instance my app's CPU usage was around 60% and RAM usage was around 5 GB.

Because RAM usage is quite less, I thought of moving this app to a compute optimized instance to save cost. Hence, I moved it to c5.xlarge instance which provides 4 vCPU and 8 GB RAM. On this instance also my app usage was same around 5 GB RAM usage and 60% CPU. It worked fine for almost 24 hours after which suddenly CPU usage went to 100% and it never went down which resulted in non responsive app.

I tried using m5.large instance as well which provides 8 GB Ram, same issue happened there also, after around 24 hours 100% CPU. Ultimately I moved it back to m5.xlarge instance and it's over 10 days my app is running fine. Usage is also same.

Now I am not able to debug why this 100% CPU usage is happening on a 8 GB instance when my RAM usage is never crossing 5 GB. I have not tuned tomcat for production environment, I am using default settings. Is there any probably cause where I should look into?

5
  • I think your app needs 16GB RAM. What process was using the CPU?
    – Tim
    Aug 19, 2020 at 7:28
  • @Tim But memory usage never exceeds 5 GB even on 16 GB machine. Most of the CPU is used by tomcat.logging properties.
    – Abhinav
    Aug 19, 2020 at 8:17
  • Is something scheduled to run once a day? Aug 19, 2020 at 8:36
  • This is pretty weird. I wonder if it's something to do with caching.
    – Tim
    Aug 19, 2020 at 9:05
  • Get it to the bad state again, capture /proc/meminfo and the top few functions on CPU via sudo perf top. Edit your question to add these details. Quite possible how you've tuned things is falling over at < 8 GB RAM, but prove what is happening with performance metrics. Aug 19, 2020 at 15:03

0

You must log in to answer this question.

Browse other questions tagged .