Search code examples
databasepostgresqlamazon-web-servicesamazon-rds

Postgres AWS RDS Database high load during random moments


My Postgres database is having a high load during random moments of the each day, and when I reboot it comes back to normal.

The performance insight below shows the queries, the problems that I can see are in DataFileRead e WALWriteLock.

The problema is that the same queries run all throughout the day without issues, but at random moments it spikes.

enter image description here

Below the graph of the last week:

enter image description here


Solution

  • I ended up changing the instance type of my RDS from a type with 4 vCPU to a type with 8 vCPU, changed from a xLarge to a 2xLarge, and it solved the problem.

    My best guess is that maybe some processes were ocuppying all the CPUs and getting the other processes stuck, resulting in this high load, and when restarting the database it "unstuck" the processes.