# PG throws could not resize shared memory segment error

**URL:** https://meta.discourse.org/t/pg-throws-could-not-resize-shared-memory-segment-error/84744
**Category:** Self-hosting
**Created:** [April 6, 2018, 4:52pm UTC](https://meta.discourse.org/t/pg-throws-could-not-resize-shared-memory-segment-error/84744 "2018-04-06T16:52:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [April 6, 2018, 5:21pm UTC](https://meta.discourse.org/t/pg-throws-could-not-resize-shared-memory-segment-error/84744/3 "2018-04-06T17:21:09Z")

</div>

This is due to the fact that docker by default [restricts shared memory size](https://www.postgresql.org/message-id/CAEepm%3D2wXSfmS601nUVCftJKRPF%3DPRX%2BDYZxMeT8M2WwLSanVQ%40mail.gmail.com) to 64MB which makes pg10 run afoul of this limitation when doing a number of scatter/gather jobs in parallel:

```plaintext
Outside the container:
supermathie@host: ~ $ df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
none 63G 1.2M 63G 1% /run/shm

Inside the container:
supermathie@host: ~ $ docker exec -it postgres-master df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
shm 64M 8.0K 64M 1% /dev/shm

```

You should raise the limit when launching the postgres container by including the `--shm-size=1g` parameter.

We’ll look at fixing this in the launcher.

(or as the link suggests, disable parallelism in pg10 with `max_parallel_workers_per_gather = 0`)

---

_[View the full topic](https://meta.discourse.org/t/pg-throws-could-not-resize-shared-memory-segment-error/84744)._
