Report this

What is the reason for this report?

Does high shared db cpu usage mean that my app is causing it?

Posted on October 10, 2024

My application is using a managed Postgres cluster, and usually, it has ~20% CPU usage with occasional spikes to 50-80%. Does it mean that my application is causing the spike, or can the load be generated by some other consumer with whom I’m sharing the CPU?



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!

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.

Hey there! 👋

When you’re using a DigitalOcean Managed PostgreSQL Database, the resources (CPU, memory, etc.) allocated to your database are dedicated specifically to your cluster and are not shared with other customers.

So, if you’re seeing a spike in CPU usage, it’s due to your own application’s queries or operations.

That being said, these spikes could be caused by several factors, such as:

  • Long-running or complex SQL queries that consume more CPU.
  • A large number of simultaneous connections or transactions.

You can keep an eye on the CPU metrics from the DigitalOcean Control Panel and set up alerts if needed. If your workload is growing, consider scaling your resources by adding more CPUs or memory to handle the additional load.

https://docs.digitalocean.com/products/databases/postgresql/how-to/monitor-clusters/

So, in short, yes, the spike is related to your cluster, and it’s not coming from another customer. Keep an eye on your queries and consider scaling if you’re seeing frequent spikes.

Hope that helps! Let me know if you have any further questions!

- Bobby

But if the plan is Basic, the documentation says that CPU is shared ->

https://docs.digitalocean.com/products/databases/postgresql/details/pricing/

(also in my control panel I see similar information). Still, in this case the load I see in insights comes only from my usage?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.