Question

Gunicorn CPU usage suddenly increased to almost 100% since jan 20

Was there anything happened around Jan 20, @21:30?

CPU jumped from average of 30% to 60%, bandwidth jumpe3d from average of 15mb/s to almost 40mb/s. There wasn’t any change in my gunicorn configuration nor my application. I ran top command and found gunicorn consumed almost 100% cpu.

  12203 chariya   20   0  822400 348132  17792 R  99.0   4.4   2:17.49 gunicorn
  12500 chariya   20   0  777204 379904  17344 R  97.3   4.8   0:45.42 gunicorn
  12518 chariya   20   0  955128 557472  17344 R  46.5   7.0   1:03.91 gunicorn
  12537 chariya   20   0  584088 186712  17344 R  45.2   2.3   0:57.25 gunicorn
  12520 chariya   20   0  501596 104076  17344 R  26.9   1.3   0:40.43 gunicorn
  12492 chariya   20   0  502640 104900  17344 S  20.6   1.3   0:37.56 gunicorn
  12485 chariya   20   0  586032 188912  17344 S   4.3   2.4   1:54.61 gunicorn
   3543 nginx     20   0  162596  25296  19636 S   1.7   0.3   4:52.36 nginx
  12206 chariya   20   0  544992 147452  17344 S   1.3   1.8   3:14.78 gunicorn


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I also had this issue where my CPU suddenly jumped up to 100%. I checked the logs of my gunicorn worker with sudo systemctl status gunicorn and realised I had a bot crawling the site taking up all of the resources. I blocked this bot in my nginx file.

Hi @cpeters5,

It’s quite possible the traffic increased. Do you have any tools to monitor traffic coming to your application? I’ll suggest checking them out. That’s the first thing that comes to my mind if you haven’t made any other changes.

See if the CPU utilization is a 100% even after in the evenings when traffic should be lower. Again this should give you some information as to what is going on.

Regards, KFSys