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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.