# Primary Postgres database process (postmaster) eating all CPU

**URL:** <https://meta.discourse.org/t/primary-postgres-database-process-postmaster-eating-all-cpu/84410>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [April 2, 2018, 10:12pm UTC](https://meta.discourse.org/t/primary-postgres-database-process-postmaster-eating-all-cpu/84410 "2018-04-02T22:12:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [April 2, 2018, 10:12pm UTC](https://meta.discourse.org/t/primary-postgres-database-process-postmaster-eating-all-cpu/84410/1 "2018-04-02T22:12:14Z")

</div>

I’ve got a 2-container install on a DO 8GB droplet that is behaving very strangely.

There is a postmaster (EDIT: now there are two of them) processing eating 100% CPU.  
Sidekiq is running, but the Dashboard complains that it’s not checking for updates.

There are some logs like

```
  PG::ConnectionBad (FATAL: remaining connection slots are reserved for non-replication superuser connections ) /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `initialize'

```

and

```
Job exception: FATAL: remaining connection slots are reserved for non-replication superuser connections	

```

The data container has:

```plaintext
  db_shared_buffers: "2GB"
  db_work_mem: "40MB"

```

There are 4 unicorn workers in the web container (same as # processors).

Plugins:

```plaintext
          - git clone https://github.com/discourse/docker_manager.git
          #- git clone https://github.com/SumatoSoft/discourse-adplugin.git
          #- git clone https://github.com/davidcelis/new_relic-discourse.git
          - git clone https://github.com/discourse/discourse-cakeday.git
          - git clone https://github.com/ekkans/lrqdo-editor-plugin-discourse.git
          #- git clone https://github.com/davidtaylorhq/discourse-whos-online.git
          - git clone https://github.com/pmusaraj/discourse-onesignal.git

```

Memory:

```plaintext
KiB Mem : 8174936 total, 169976 free, 1288084 used, 6716876 buff/cache
KiB Swap: 2097148 total, 2094304 free, 2844 used. 4369992 avail Mem 

```

---

_[View the full topic](https://meta.discourse.org/t/primary-postgres-database-process-postmaster-eating-all-cpu/84410)._
