Huge amount of RAM usage on postgresql
itreza7
PROOP

2 months ago

I’m currently migrating my PostgreSQL databases from DigitalOcean to Railway. After moving only 3 out of 12 databases, I’ve observed that RAM usage on Railway has increased significantly—reaching around 7GB per node.

This is unexpected because, on DigitalOcean, the total memory usage for all 12 databases stayed under 50% of an 8GB instance, even during higher load periods. At the moment, we are not experiencing peak traffic, yet the memory consumption is already close to the limit.

Could you help clarify why the RAM usage is scaling almost proportionally to the data volume and why it differs so much from the previous environment?

$10 Bounty

1 Replies

Status changed to Open Railway about 2 months ago


domehane
FREE

2 months ago

Hello itreza7,

first run "show shared_buffers;" on each of your railway postgres services. railway runs each postgres instance as a container and shared_buffers gets allocated upfront at startup even when idle, so it eats ram regardless of traffic. if the value seems high for your actual data size you can lower it with "alter system set shared_buffers = 'X';" where x fits your workload, then restart from the railway dashboard. also worth checking how many separate postgres services you spun up on railway since each one runs its own process with its own memory overhead. share those findings and it'll be much easier to pinpoint the issue


Welcome!

Sign in to your Railway account to join the conversation.

Loading...