Hello,
I’m currently facing two challenges with my DigitalOcean database setup:
Prisma Connection Pooling
I’m using Prisma with DigitalOcean’s database services and would like guidance on whether I should define or adjust the connection pool size. Should I explicitly configure Prisma’s connection pool settings to optimize performance, or is the default configuration sufficient for handling spikes in workload? High Load Average
During peak usage hours (about 8 hours daily), the load average on my database server spikes up to 18. The current configuration is 8 GB RAM, 2 vCPUs, and 60 GB Disk. Should I upgrade my database configuration to handle these spikes better? If so, what would be the best configuration to manage high, consistent workloads effectively? Thank you for your assistance. I look forward to your recommendations.
Best regards,
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! 👋
For DigitalOcean Managed Databases, you could actually handled your connection pooling on the database level directly. Since DigitalOcean provides managed PgBouncer, you should use that instead:
You can learn more about managing connection pools with DigitalOcean Managed Databases here:
Regarding the resources, before upgrading, you can check if slow queries are the culprit. You can visit the cluster’s Settings > Logs (or Logs & Queries). The Currently running queries section tracks all of the PostgreSQL cluster’s open connections, potentially resulting in queries with long durations.
If you find slow queries, you can optimize them by adding appropriate indexes. For example, if you’re frequently searching or sorting by
ticket_number
, you can add an index like this:To learn more about indexes, you can check out this tutorial here.
If after query optimization and connection pooling are in place, and you still see high load on the database, then you can consider upgrading the resources:
So my recommendation would be:
DigitalOcean Managed Databases handle a lot of the optimization automatically, so focus on application-level optimizations first!
Another thing that you can consider here is caching. For example you can use a Redis cache for frequently accessed data that doesn’t change often to reduce the load on the database:
Feel free to share more details about your application and database usage, and I will be happy to provide more specific recommendations!
- Bobby
This comment has been deleted