Reet Shrivastava
Reet Shrivastava

Reputation: 51

Gunicorn CPU usage increasing to a very high value

We are using Gunicorn with Nginx. After every time we restart gunicorn, the CPU usage took by Gunicorn keeps on increasing gradually. This increases from 0.5% to around 85% in a matter of 3-4 days. On restarting gunicorn, it comes down to 0.5%. Please suggest what can cause this issue and how to go forward to debug and fix this.

Upvotes: 5

Views: 8470

Answers (1)

Bzzoiro
Bzzoiro

Reputation: 111

  • Check workers configuration. Try use the following: cores * 2 -1
  • Check your application, seems that your application is blocking / freezing threads. Add timeout to all api calls, database queries, etc.
  • You can add an APM software to analyze your application, for example datadog.

Upvotes: 5

Related Questions