Supabase postgres memory management question
I have a specific question about how you manage postgres connexions and out of memory.
If one connection eats too much memory, more than provisioned, how does supabase reacts ?
1. Does it kill postgres postmaster processes and postgres need restart
2. It kills the process related to the connexion only, so the request fails but postgres does not need a restart
3. Other ?
1 Reply
Postgres is pretty good at limiting how much memory any given connection (each connection is one backend postgres process in the operating system) is allowed to use. The limits are auto-scaled based on the memory the server itself has. In all my years using postgres heavily, I don't recall ever having a process killed for out of memory. I'm not so familiar with how linux' OOM killer may interact with it since I did not run under linux.
If the OS does kill one of the processes, postgres will notice it and will forcibly disconnect all of the others in an effort to prevent any on-disk corruption.