1

There's a server that might be experiencing PostgreSQL database connection leaks. That server has also maxed out it's CPU at times (as indicated by %user being extremely high upon running sar -u). Could database connection leaks be causing the abnormally high CPU usage?

Daniel
  • 1,774
  • 2
  • 22
  • 38
  • what is database connection leaks?.. – Vao Tsun May 05 '17 at 07:03
  • An example's the scenario mentioned in https://github.com/benoitc/gunicorn/issues/996 , described as "connection leaks" here http://stackoverflow.com/a/32509617/805141 – Daniel May 05 '17 at 07:18
  • ah - it's Django feature! I understand now - pool does not reuse sessions or alike?.. Then it has nothing to do with postgres user 100% CPU - is it postgres who eats CPU?.. – Vao Tsun May 05 '17 at 07:25
  • I'm not sure. Could you please tell me how to check? – Daniel May 05 '17 at 07:31
  • `top` will show you both cpu and user and it orders by CPU load by default I think – Vao Tsun May 05 '17 at 07:35

1 Answers1

1

This can happen if the connections are busy running queries that take forever and consume CPU.

Use operating system tools on the PostgreSQL server to see which processes consume CPU. On Linux that would be top.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263