# 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:** 13

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [May 28, 2020, 6:00am UTC](https://meta.discourse.org/t/primary-postgres-database-process-postmaster-eating-all-cpu/84410/13 "2020-05-28T06:00:25Z")

</div>

Just a heads up, I had the same issue and it was fixed by doing this:

> [@Slow Sidekiq + Postmaster using 95%+ CPU (32 cores) after Postgresql Version Upgrade](https://meta.discourse.org/t/slow-sidekiq-postmaster-using-95-cpu-32-cores-after-postgresql-version-upgrade/152983/19):
>
> Ok so to follow up, everything still looks good, postmaster has calmed down drastically and sidekiq is moving really fast again. To summarise on what worked in my scenario (with default db name of ‘discourse’): cd /var/discourse/ ./launcher enter app sudo -u postgres psql \c discourse Then from the postgres console, each of these below were run. Each one takes a bit of time to complete, depending on DB size, heavy CPU usage for the first two also: VACUUM FULL VERBOSE; REINDEX DATABASE disco…

---

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