Default pg_cron schedule causes constant 1MB/s disk writes from index building tasks
Author: dtinthCreated Aug 13, 2025Updated Jun 18, 2026
Labelscode/bugnot readycommunity
I installed FerretDB on my Synology NAS, and immediately my hard disk started making constant noise and disk activity LED flashing constantly. This is what prompted me to investigate.
FerretDB, PostgreSQL, and DocumentDB versions
{
"host": "1bae1b0e62f9",
"version": "7.0.77",
"process": "ferretdb",
"pid": 1,
"uptime": 51111.632588256,
"uptimeMillis": 51111632,
"uptimeEstimate": 51111,
"localTime": "2025-08-13T07:36:21.317Z",
"freeMonitoring": {
"state": "undecided"
},
"metrics": {
"commands": {
"find": {
"total": 5601,
"failed": 0
},
"hello": {
"total": 7929,
"failed": 0
},
"listDatabases": {
"total": 43,
"failed": 0
},
"ping": {
"total": 845,
"failed": 0
},
"aggregate": {
"total": 28,
"failed": 0
},
"collStats": {
"total": 28,
"failed": 0
},
"createIndexes": {
"total": 19,
"failed": 0
},
"serverStatus": {
"total": 4,
"failed": 0
},
"endSessions": {
"total": 11,
"failed": 0
},
"getMore": {
"total": 8,
"failed": 0
},
"dbStats": {
"total": 7,
"failed": 0
},
"listCollections": {
"total": 47,
"failed": 0
},
"update": {
"total": 29458,
"failed": 0
},
"saslContinue": {
"total": 25,
"failed": 0
},
"create": {
"total": 1,
"failed": 0
},
"listIndexes": {
"total": 28,
"failed": 0
},
"ismaster": {
"total": 89,
"failed": 0
}
}
},
"catalogStats": {
"collections": 0,
"clustered": 0,
"timeseries": 0,
"views": 0,
"internalCollections": 0,
"internalViews": 0
},
"ferretdb": {
"version": "v2.5.0",
"gitVersion": "b4eda04f375ca6eb63867d36901787e5af6d0eb6",
"buildEnvironment": {
"-buildmode": "exe",
"-compiler": "gc",
"-trimpath": "true",
"CGO_ENABLED": "0",
"GOAMD64": "v1",
"GOARCH": "amd64",
"GOOS": "linux",
"go.runtime": "go1.24.5",
"go.version": "go1.24.5",
"vcs": "git",
"vcs.modified": "true",
"vcs.revision": "b4eda04f375ca6eb63867d36901787e5af6d0eb6",
"vcs.time": "2025-08-12T11:06:25Z"
},
"debug": false,
"package": "docker",
"postgresql": "PostgreSQL 17.5 (Debian 17.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit",
"documentdb": "0.106.0 gitref: HEAD sha:beb9d25d98 buildId:0"
},
"ok": 1
}Environment
- OS: Synology DSM on DS423+ (Linux 4.4.302+ x86_64 synology_geminilake_423+)
- Deployment: Docker Compose using
ghcr.io/ferretdb/ferretdb:2.5.0andghcr.io/ferretdb/postgres-documentdb:17-0.106.0-ferretdb-2.5.0 - Deployment details: Docker Compose, containers started immediately show excessive disk I/O
What did you do?
Started FerretDB with PostgreSQL backend using Docker Compose:
services:
postgres:
image: ghcr.io/ferretdb/postgres-documentdb:17-0.106.0-ferretdb-2.5.0
restart: unless-stopped
environment:
- POSTGRES_USER=dtinth
- POSTGRES_PASSWORD=***
- POSTGRES_DB=postgres
volumes:
- ./data/db:/var/lib/postgresql/data
ferretdb:
image: ghcr.io/ferretdb/ferretdb:2.5.0
restart: unless-stopped
ports:
- 127.0.0.1:27017:27017
environment:
- FERRETDB_POSTGRESQL_URL=postgres://dtinth:***@postgres:5432/No MongoDB operations performed - issue occurs immediately upon container startup.aml
What did you expect to see?
Normal resource usage during idle periods with no active MongoDB operations.
What did you see instead?
Immediate excessive disk I/O (1MB/s continuous writes) causing:
- Hard drives making constant noise
- Activity LED flashing continuously
postgres: pg_cronlauncher process writing to disk constantly
Investigation showed pg_cron jobs scheduled every 2 seconds:
- documentdb_index_build_task_1: CALL documentdb_api_internal.build_index_concurrently(1);
- documentdb_index_build_task_2: CALL documentdb_api_internal.build_index_concurrently(2);
Query result:
SELECT * FROM cron.job;
jobid | schedule | command | active
-------+-----------+------------------------------------------------------------+--------
2 | 2 seconds | CALL documentdb_api_internal.build_index_concurrently(1); | t
3 | 2 seconds | CALL documentdb_api_internal.build_index_concurrently(2); | tI confirmed that these 2 jobs are causing excessive disk writes by disabling these jobs:
UPDATE cron.job SET active = false WHERE jobid IN (2, 3);FerretDB logs show normal startup - no errors related to this issue.
Source: FerretDB/FerretDB