Skip to content
Next.js landing site holding ~1.84 GB RAM with very low traffic
lrazuri
OP

13 days ago

My Landing service in project agile-elegance, production environment, is consistently reporting around 1.84 GB RAM despite very low CPU usage and approximately 1,563 requests over seven days.

Could you clarify:

  • Does the billed memory include filesystem cache or other container memory beyond the application process?
  • Can you help distinguish application memory from cache/platform overhead?
  • Are there known memory-accounting or runtime issues affecting this deployment?
  • What diagnostics should I capture before restarting or redeploying?

The application uses Next.js with Sharp image optimization. We’re investigating application-level memory retention separately.

Solved

5 Replies

Railway
BOT

13 days ago

Memory billing is based on what we measure for the whole container from the host, not on a figure the application reports, so readings taken inside the container (process RSS or the Node heap, for example) can cover a narrower scope and come out lower than the Metrics tab. The Metrics tab is the record of what the service used, and billing follows that measured usage, not the replica limit you have set.

From those metrics we can see how much memory the Landing service uses, but we can't see inside the application. That means we can't split that figure into the app's own memory and cache or overhead, or tell why it is holding about 1.84 GB. Working that out needs application-level monitoring or profiling on your side, which fits with the investigation you're already running.

Your Landing service's current deployment shows as running successfully.


Status changed to Awaiting User Response Railway • 13 days ago


lrazuri
OP

13 days ago

Thanks, that clarifies that billing uses whole-container memory.

Before restarting or redeploying, could you confirm:

  • Does the billed measurement include reclaimable filesystem/page cache?
  • Which container/cgroup metric corresponds to the memory shown in Railway’s Metrics tab?
  • What read-only commands would you recommend to compare that measurement with Node’s process memory and heap?

I understand application profiling is needed. I want to distinguish application allocations from cache and container overhead so I can investigate the right cause.


Status changed to Awaiting Railway Response Railway • 13 days ago


Railway
BOT

13 days ago

The memory figure in the Metrics tab, which billing follows, is the container's measured memory usage plus any swap it uses, read from the host for the whole container rather than for a single process. We aren't able to confirm from here whether reclaimable page cache is excluded from that figure, so a gap between it and Node's own numbers shouldn't be read as cache on its own.

Process memory and heap readings from inside the container can cover a narrower scope than our host-side measurement, so they won't map one-to-one onto a single in-container metric, and a lower internal reading doesn't by itself mean the platform figure is wrong. Splitting application allocations from everything else in the container is the job of the application-level profiling you're already running.


Status changed to Awaiting User Response Railway • 13 days ago


lrazuri
OP

13 days ago

Thanks. I understand application profiling is our responsibility. We’ve reviewed service metrics and request logs; we haven’t yet collected process or cgroup memory measurements.

Could a Railway team member confirm the exact host-side metric or calculation used for billed memory, including how swap and reclaimable filesystem/page cache are handled?

I’m asking about the platform’s measurement definition so we can compare our diagnostics correctly.


Status changed to Awaiting Railway Response Railway • 13 days ago


Railway
BOT

13 days ago

Billed memory comes from the container's cgroup, read from the host. Each sample is the cgroup's total memory usage plus its swap usage, and the Metrics tab averages those samples per time bucket. Billing adds up the same measurement over time as GB-minutes. The configured memory limit is a separate value and is not what you are billed for.

We don't apply any extra adjustment to take page cache out. Whatever the container's cgroup counts as used memory is what gets measured. A reading of memory.current from inside the container leaves out swap, and it can also cover a different cgroup scope than our host-side reading, so the two may not line up exactly.


Status changed to Awaiting User Response Railway • 13 days ago


Railway
BOT

6 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 6 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...