Postgres volume growing >20MB/day but actual data is only 10MB?
patrickbauer
HOBBYOP

3 months ago

Hey Railway team! ☺️

I'm running a small HedgeDoc instance and noticed my Postgres volume is growing steadily at around 20MB/day. It's currently at 768MB, but the actual database data is minimal:

Database size: ~9.4 MB
WAL files: 32 MB (2 files)
Replication slots: none
archive_mode: off

The tables contain only 14 notes, 10 users, and ~250 sessions.

I've run diagnostics and Postgres itself appears healthy - WAL is being recycled properly, no bloat, and autovacuum is running as expected. The growth seems to originate from outside of Postgres.

For reference, my other postgres volume has remained stable at around 200MB till now, but it has a lot less traffic.

Any guidance would be appreciated. Thanks!

Project: 8ea5b1fe-42e1-4796-b7f2-856e60221277
Volume: 71fbc9bd-84a0-4616-8347-1e1e3d7306f6

$10 Bounty

3 Replies

dardameiz
PRO

3 months ago

Can you run this bash and check if it comes from logs or temps file?

du -sh /var/lib/postgresql/data/*

For HedgeDoc 250 sessions might be generating a lot of logs. Check if log_statement or log_connections are enabled. If it turns out to be logs, the problem, you might adjust log_min_duration_statement for logging only slow queries.


fra
HOBBYTop 10% Contributor

3 months ago

When you say it is growing, you mean the volume in the volume graph or in the workspace dashboard? The graph in the workspace dashboard is a cumulative value, so it is normal it increase every day


patrickbauer
HOBBYOP

a month ago

Sorry this has been stale so long, but I came back to this now. The volume has grown to 1GB in size and has stabilized there.

Whats even stranger. If I look at it via SHH, the actualy volume only takes up 65MB of spaces - where is this huge volume space coming from?

bash-5.1# df -h /var/lib/postgresql/data
Filesystem                Size      Used Available Use% Mounted on
/dev/zd10608              4.5G     65.8M      4.4G   1% /var/lib/postgresql/data

1465387113548746800


Loading...