Pg_dump memory spike
We run a backup each night for a Postgress DB with the default railway postgres backup template. In the image you can clearly see the time it starts when the memory usage spikes. The spike is fine, although I am wondering why the usage remains so high for so long, since the backup only takes 5 mins, but it takes almost 12 hours to return the usage to 'normal'.
Solution:Jump to solution
honestly I have no clue, I have experienced this before as well, my solution was to run the backup in a sort of a single shot mode, meaning when the code starts it takes a backup and exits, that way you can use railways scheduler, you will still pay for that spike of memory, but you won't pay for any memory after that spike because the entire container will exit
3 Replies
Project ID:
a0f3572b-295e-4a43-b776-ce352a4d0980
a0f3572b-295e-4a43-b776-ce352a4d0980
Service ID: 54e153e1-ea03-4c98-b467-51462df56889
Solution
honestly I have no clue, I have experienced this before as well, my solution was to run the backup in a sort of a single shot mode, meaning when the code starts it takes a backup and exits, that way you can use railways scheduler, you will still pay for that spike of memory, but you won't pay for any memory after that spike because the entire container will exit