Wednesday, June 10, 2020

[google-cloud-sql-discuss] Postgres 11 Ubuntu 18.4 - Randomly crashing

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?





--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/397da3b4-e7f6-4006-b386-16fe6c9f0d3do%40googlegroups.com.

No comments:

Post a Comment