Skip to content

Weird out of memory crashes #809

@JuniorJPDJ

Description

@JuniorJPDJ

I'm having very weird issue.
I limited my postgres to 20G of RAM.
Then used loads of config generators like https://pgtune.leopard.in.ua/ or http://pgconfigurator.cybertec.at/ to setup.
Always using 16GB of ram in generator.
And then few times a week some worker's getting killed by out of memory error and whole DB is getting restarted.
I heard much people are using this configurators and noone ever had similar issue, my friend suggested it may be problem with docker container.

This is my docker-compose.yml:

version: '2.4'

services:
  postgres:
    image: postgres:13-alpine
    restart: unless-stopped
    stop_grace_period: 2m
    networks:
      - postgres
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
    mem_limit: 20G
    cpus: 5.0
    environment:
      - POSTGRES_PASSWORD=<redacted>
      - LANG=C
      - POSTGRES_INITDB_ARGS="--encoding=UTF-8"

networks:
  postgres:
    name: postgres
    internal: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions