Recently we moved our full stack website to new server (Vultr instance). After moving to new server we are constantly getting 400% CPU usage issue.
It's been fifth day since we are getting 400% CPU usage.
Debugging issue leads us to the articles regarding vacuum
/ autovacuum
which is used by postgress database to reclaims storage occupied by dead tuples. And it is recommended to keep ON.
We don't want to terminate the process as our site is live and we don't want to mess up anything.
Here's more on what we have done for the server migration.
We cloned and deployed frontend application using nginx.
For backend, we make dbdump
of database (dbdump file of 25 MB) from the old server and restored on new server
We did restored data twice first time as just trial and second time while actually moving the data. Before importing data we dropped existing database.
Also we used official postgres docker image for our database.
Here's the result of htop
command from the server.
High CPU usage process image
Now we don't understand what to do to reduce server CPU load.
NOTE: We are running default configuration of the postgres docker image.
Device info
OS: Ubuntu 22.04.1 LTS
RAM: 8 GB
Processor: 4x AMD EPYC-Rome Processor
Vultr, CPU Optimized - 4 vCPU, 8192 MB RAM, 75 GB NVMe, 6.00 TB Transfer