Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running analyze in 50GB local database, Docker runs out of space due to shared memory #600

Open
yanokwa opened this issue Feb 27, 2024 · 0 comments

Comments

@yanokwa
Copy link
Member

yanokwa commented Feb 27, 2024

I tried to run vacuum analyze on a 50 GB database and got pq: could not resize shared memory segment "/PostgreSQL.2058389254" to 12615680 bytes: No space left on device error.

This is because docker by-default restrict size of shared memory to 64MB.

https://meta.discourse.org/t/pg-throws-could-not-resize-shared-memory-segment-error/84744/8 suggests that 512MB is a safe default, and I can confirm that it fixed my problem.

version: "3"
services:
  postgres14:
    build:
      context: .
      dockerfile: postgres14.dockerfile
    shm_size=512m
    volumes:
      - postgres14:/var/lib/odk/postgresql/14

I don't necessarily thing we should add this to the docker-compose, especially given that we'll be moving binaries out of the DB, but I figured I'd file an issue so the solution is out in the world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant