Postgres 11 Ubuntu 18.4 - Randomly crashing

65 views
Skip to first unread message

Juan Francisco Vasquez

unread,
Jun 10, 2020, 4:58:57 PM6/10/20
to Google Cloud SQL discuss
We have 2 servers for postgres master and replica, the second one is used only for reporting it has 23GB memory and 16 vCPU and a database of almost 200GB of memory

Randomly postgres is being killed by Linux with the following message

Jun 10 05:51:18 db02 kernel: [595622.012354] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/system-postgresql.slice,task=postgres,pid=28305,uid=112
Jun 10 05:51:18 db02 kernel: [595622.012382] Out of memory: Killed process 28305 (postgres) total-vm:10918716kB, anon-rss:2963608kB, file-rss:0kB, shmem-rss:5741588kB
Jun 10 05:51:18 db02 kernel: [595622.199406] oom_reaper: reaped process 28305 (postgres), now anon-rss:0kB, file-rss:0kB, shmem-rss:5741588kB

Which as far as I know is when Ubuntu has to kill one process to keep the OS working.

These are the settings I have in postgres.conf file

related to memory

# - Memory -

shared_buffers = 6GB                                             
temp_buffers = 18MB                     # min 800kB
work_mem = 32MB                         # min 64kB
maintenance_work_mem = 1536MB           # min 1MB
effective_io_concurrency = 200          # 1-1000; 0 disables prefetching
max_worker_processes = 14               # (change requires restart)
max_parallel_workers_per_gather = 7     # taken from max_parallel_workers
max_parallel_workers = 14               # maximum number of max_worker_processes that
wal_buffers = 16MB                      # min 32kB, -1 sets based on shared_buffers

I have seen that behavior getting only one report, so basically my question is should I change anything in my configuration to avoid this? Is there any recommendation like increasing RAM or something else based on the information I just provided?





Elliott (Google Cloud Platform Support)

unread,
Jun 10, 2020, 7:07:36 PM6/10/20
to Google Cloud SQL discuss
Hello Juan,

Are you using Cloud SQL or Virtual machines on Google Cloud?

Juan Francisco Vasquez

unread,
Jun 10, 2020, 7:45:06 PM6/10/20
to Google Cloud SQL discuss
I VMs on GCP.
Reply all
Reply to author
Forward
0 new messages