- Newest
- Most votes
- Most comments
Apparently bots can cause this even if their crawling triggers one of the quickest requests. Quantity over quality here. Please delete the thread.
answered 7 years ago
What version of PostgreSQL is this?
Have you tried Performance Insights to see where the load is coming from?
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html
Kyle
answered 7 years ago
It sounds like you're dealing with a frustrating CPU issue on your RDS Postgres instance, especially since you've ruled out application traffic as the cause. Given that the CPU usage is high even with no active connections, the problem is almost certainly internal to the database itself. The most common culprits for this behavior are either a long-running or "stuck" query (perhaps initiated by a crawler or a background job and now running inefficiently) or intensive autovacuum processes. Postgres runs these maintenance tasks in the background to clean up the database, and if a table has seen a significant number of updates or deletes, autovacuum can consume considerable CPU resources to manage it. To diagnose this, your best tool is AWS RDS Performance Insights. Enable it if you haven't already, and set the timeframe to the period of high CPU usage; it will give you a clear, visual breakdown of exactly which queries or wait events (like I/O or locks) are consuming the CPU. You can also connect to your database and run a query against the pg_stat_activity view to see all current connections and their states; look for queries that have been running for a long time or connections that are stuck in an idle transaction state, as these can prevent vacuuming from completing. If you identify a problematic query, you can terminate its specific backend process for immediate relief using pg_terminate_backend(). For a long-term fix, you'll need to optimize that query, potentially by adding an index. However, given that you are on a db.t2.large burstable instance, it's also highly recommended to consider upgrading to a fixed-performance instance class, such as a db.m5.large. This will eliminate the CPU credit mechanism entirely, providing you with consistent CPU performance and preventing your database from being throttled, which is a critical consideration for any production environment.
answered a year ago
Relevant content
asked 5 months ago
asked 2 years ago
