- Newest
- Most votes
- Most comments
There are a few potential issues that could explain what you're experiencing with your Lightsail database:
- Regarding the slowness that improves after restart: This is a common pattern with database systems. When you restart the database, it clears the query cache and buffer cache, which then need to be rebuilt. The temporary performance improvement after restart suggests that your database might be experiencing issues with statistics, query plans, or resource utilization.
You might want to try running ANALYZE and REINDEX operations on your database. These operations update statistics and optimize indexes, which can significantly improve performance, especially if they haven't been run in a long time.
- Regarding the automatic upgrade: Amazon Lightsail databases (which use RDS under the hood) have automatic maintenance mechanisms. The "Upgrading" state you observed was likely due to one of these:
- Automatic patching: RDS applies critical patches during maintenance windows
- Major version upgrades: These can be scheduled and will occur during maintenance windows
- Automatic restart: RDS instances automatically restart after 7 days if they've been in a "Stopped" status
You can verify if an upgrade was scheduled by using the AWS CLI command:
aws lightsail get-relational-database --relational-database-name YourDatabaseName --region YourRegion
To prevent these issues in the future:
- For performance issues:
- Regularly schedule maintenance tasks like ANALYZE and REINDEX
- Monitor query performance and optimize slow queries
- Consider upgrading your database plan if you're hitting resource limits
- For unexpected upgrades/restarts:
- Check your maintenance window settings and adjust them to less impactful times
- Monitor the "pendingModifiedValues" in your database description to see if upgrades are scheduled
- Create database snapshots before maintenance windows as a precaution
If the performance issues persist after these steps, you might need to investigate specific query patterns or consider database parameter tuning.
Sources
Aurora RDS slow performance | AWS re:Post
Lightsail RDS Instance - Restarted on its own | AWS re:Post
Upgrade the major version of a Lightsail database - Amazon Lightsail
RDS restarting without notification | AWS re:Post
answered a year ago
