Question

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

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?


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.

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?

Bobby Iliev
Site Moderator
Site Moderator badge
October 11, 2024

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more