i'm currently investigating a situation where my PostgreSQL 9.3 instance was killed by the Linux OOM Killer and went to recovery mode. The machine is EC2 Server with 16 GB of RAM and has rather few connections and is used for Business Analsys purposes only.
My assumption is that the reason for the out of memory situation is on one hand a very huge statement but also the fact that work_mem variable is set to 2GB while at the same time 100 connections are allowed.
And here are my questions:
- is my assumption correct
- if so, how can i force postgres to fill the session memory in a controlled manner to make the situation repeatable
I hope you guys can help me soon, thanks in advance and have a good week.
work_mem
setting, as it's obviously much too high? (And allow fewer concurrent connections?) And don't use cryptic abbreviations like "BI" in your question. This is supposed to be publicly readable.work_mem
'Specifies the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files' - so write some huge sort operations, start them from several connections and there you are. Anyway, what are the kernel overcommit settings on your instance?