# Health check for your postgres database has failed. Your database is malfunctioning

**URL:** <https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776>\
**Category:** Questions / Help\
**Tags:** logs, postgres, databases, login-only\
**Created:** [January 9, 2026, 10:19am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776 "2026-01-09T10:19:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 9, 2026, 10:19am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/1 "2026-01-09T10:19:38Z")

</div>

We are frequently encountering this issue on our unmanaged `PostgreSQL` server and would like to identify the root cause of the recurring **health check failures**.

`Fly checks :`

| Check | Status | Output | Updated |
| --- | --- | --- | --- |
| pg | passing | [✓] connections: 178 used, 3 reserved, 300 max (551.58ms) [✓] cluster-locks: No active locks detected (30.22µs) [✓] disk-capacity: 20.0% - readonly mode will be enabled at 90.0% (25.12µs) | 2026-01-09 07:01:12 |
| vm | critical | 500 Internal Server Error [✓] checkDisk: 2.29 GB (80.0%) free space on /data/ (45.42µs) [✓] checkLoad: load averages: 0.49 0.33 0.25 (228.77µs) [✓] memory: system spent 0s of the last 60s waiting on memory (33.84µs) [✗] cpu: system spent 1.77s of the last 10 seconds waiting on cpu (23.14µs) [✓] io: system spent 0s of the last 60s waiting on io (21.19µs) | 2026-01-08 08:22:02 |
| role | passing | primary | |

![image](https://global.discourse-cdn.com/fly1/optimized/3X/6/b/6b3f0f277a4bfb57805c143d513bd812ea5c01fe_2_690x43.png)

---

<div class="post-metadata">

**Author:** ![erlangga](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@erlangga](https://community.fly.io/u/erlangga)\
**Post date:** [January 9, 2026, 6:54pm UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/3 "2026-01-09T18:54:55Z")

</div>

i usually encounter this

in my case prolly one of this

- cpu shared balance is gone
- Out of memory
- Out of disk
- Our lack of cpu compute

---

<div class="post-metadata">

**Author:** ![halfer](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@halfer](https://community.fly.io/u/halfer)\
**Post date:** [January 9, 2026, 9:38pm UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/4 "2026-01-09T21:38:12Z")

</div>

I’d say that if you have to ask, it would be better to move onto a managed service. DBA stuff is expert-level stuff that most engineers (and all vibe-coders) should try to avoid.

For now, I dare say you will want to fix what you have. Consider posting these details in this thread:

- How many machines are in the cluster
- The disk space free/consumed on each one
- Any useful graphs/metrics from Grafana

Your load averages `0.49 0.33 0.25` i.e. CPU look fine, but it’s the same VM section that failed the check. It’s not clear to me what is producing that 500 error.

---

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 10, 2026, 7:43am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/5 "2026-01-10T07:43:17Z")

</div>

Thanks for the pointers — sharing the details below:

**Cluster size:** 3 machines  
**Region:** SIN  
**Machine size:** shared-cpu-1x @ 1024MB on all nodes

**Primary Machine** → **2/3** checks passing fewer times becomes **1/3**  
**Other two**  **machines** → **3/3** checks passing

Disk space info (ran `df-h` command after ssh) :

**Machine 1 (Primary):**

```auto
Filesystem Size Used Avail Use% Mounted on
none 7.8G 29M 7.4G 1% /
/dev/vdb 7.8G 29M 7.4G 1% /.fly-upper-layer
shm 482M 1.1M 481M 1% /dev/shm
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vdc 2.9G 418M 2.3G 16% /data

```

**Machine 2:**

```auto
Filesystem Size Used Avail Use% Mounted on
none 7.8G 29M 7.4G 1% /
/dev/vdb 7.8G 29M 7.4G 1% /.fly-upper-layer
shm 482M 1.1M 481M 1% /dev/shm
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vdc 2.9G 418M 2.3G 16% /data

```

**Machine 3:**

```auto
Filesystem Size Used Avail Use% Mounted on
none 7.8G 29M 7.4G 1% /
/dev/vdb 7.8G 29M 7.4G 1% /.fly-upper-layer
shm 482M 1.1M 481M 1% /dev/shm
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vdc 2.9G 385M 2.4G 14% /data

```

**Grafana Metrics (Primary Machine) attatched below:**

> **[The AI workspace that works for you. | Notion](https://swasthk.notion.site/Grafana-Metrics-2e44719f653a80398abcf80f5e42c781)**
>
> A tool that connects everyday work into one space. It gives you and your teams AI tools—search, writing, note-taking—inside an all-in-one, flexible workspace.

---

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 10, 2026, 7:45am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/6 "2026-01-10T07:45:48Z")

</div>

Are you using `shared-cpu` ?

---

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 10, 2026, 7:54am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/8 "2026-01-10T07:54:32Z")

</div>

The below status is when the machine went down to `1/3` checks recently

| Component | Status | Details |
| --- | --- | --- |
| pg | critical | 500 Internal Server Error  
✗ connections: Timed out (316.62ms)  
- cluster-locks: Not processed  
- disk-capacity: Not processed |
| vm | critical | 500 Internal Server Error  
✓ checkDisk: 2.29 GB (80.0%) free space on `/data`  
✓ checkLoad: load averages: 0.49 0.33 0.25  
✓ memory: system spent 0s of the last 60s waiting on memory  
✗ cpu: system spent 1.77s of the last 10 seconds waiting on cpu  
✓ io: system spent 0s of the last 60s waiting on io |
| role | passing | primary |

---

<div class="post-metadata">

**Author:** ![erlangga](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@erlangga](https://community.fly.io/u/erlangga)\
**Post date:** [January 10, 2026, 7:59am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/9 "2026-01-10T07:59:22Z")

</div>

try to use performance cpu 2x first for couple minutes and then after that scale down to cpu 4x shared

cpu 1x shared is really useless for real project that have real user, for db atleast use 2x cpu  
redis 1x cpu. if its QA env for budget just enable auto stop machine

---

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 10, 2026, 8:48am UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/10 "2026-01-10T08:48:03Z")

</div>

Thanks… will try this and share output

---

<div class="post-metadata">

**Author:** ![Swasthik](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/swasthik/32/43921_2.png) [@Swasthik](https://community.fly.io/u/Swasthik)\
**Post date:** [January 16, 2026, 2:54pm UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/11 "2026-01-16T14:54:22Z")

</div>

Scaled up to `shared-cpu-2x@2048MB` seems like all the checks are passing, will keep track of the machine for few more days

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [January 23, 2026, 2:55pm UTC](https://community.fly.io/t/health-check-for-your-postgres-database-has-failed-your-database-is-malfunctioning/26776/12 "2026-01-23T14:55:22Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
