Report this

What is the reason for this report?

My Postgres instance slowed down by 50% after resizing to a larger instance.

Posted on February 22, 2024

Hi Digital Ocean team, I am writing to bring to your attention an issue I’ve encountered with our managed Postgres DB instance, specifically regarding its connection pool (22/47). Initially, the database was provisioned with a configuration of 1vCPU and 2GB RAM.

However, it became apparent that this setup was insufficient to adequately serve our application’s needs. Consequently, we upgraded the instance to 2vCPU/4GB RAM in an attempt to improve performance.

Unfortunately, rather than experiencing the desired enhancement, we observed a significant slowdown in performance, with a notable decrease of approximately 50%. For instance, a basic select query that previously took 8 seconds to complete now requires substantially more time.

Given the critical nature of this issue and its impact on our operations, I kindly request your immediate assistance in resolving it. Any insights, recommendations, or actions you can provide to optimize the performance of our Postgres DB instance would be greatly appreciated.

Thank you for your prompt attention to this matter.



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 @namnguyenshrimp,

I’m sorry to hear about the performance issues you’re experiencing with your upgraded Postgres instance. It’s quite perplexing to encounter a slowdown after upgrading to a seemingly more robust configuration.

Please reach out to our amazing support team who will be more than happy to assist you with your issue! :)

https://www.digitalocean.com/support/

Besides that, here are some general tips on how to troubleshoot such performance issues:

  • Use EXPLAIN or EXPLAIN ANALYZE on your slow queries to understand if and how their execution plans have changed following the upgrade. It’s possible that the instance resizing led to changes in the query planner’s behavior.

  • Check if all your indexes are intact and consider reindexing if necessary. Also, ensure that auto-vacuuming is properly configured and running as expected, as this can impact performance.

  • Monitor the CPU, memory, and I/O usage of your new instance. Compare these metrics to those from before the upgrade. This can help identify any new bottlenecks.

  • Look for any locking issues or increased block reads/writes that might be contributing to the slowdown. Long-running locks, in particular, can severely impact performance.

  • If your application’s usage pattern has changed around the time of the upgrade (e.g., more concurrent connections or different types of queries), it might contribute to the observed performance issues.

  • Review application logs for errors or warnings that may indicate issues with database interactions.

Hope that helps!

- Bobby.

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.