Jump to content

Checking seedbox RAM usage

From Pulsed Media Wiki


On a Pulsed Media seedbox, a look at the Welcome page, or one SSH command, tells you whether your account is short of memory or only holding page cache, before you pay for more RAM. The Memory tile on the Welcome page puts your programs' memory in the big number and shows page cache, the file data Linux keeps in spare RAM, as a separate grey part of the bar. The pressure word under it and the "RAM limit exceeded" alert are worked out from your programs' memory, not from cache, so a bar that looks full of cache is not a warning.

Reading the Memory tile

The tile on your panel's Welcome page shows:

  • The big number is process memory: what rTorrent, your other torrent clients, Docker containers and any programs you started are using, shown against your plan's RAM.
  • The bar fills with process memory in colour and page cache in grey. Hovering over the tile shows the panel's own explanation: process memory, with page cache shown in grey and reclaimed when needed.
  • The line under it shows how much page cache your account holds after the word cache, then the panel's pressure word after pressure. If the panel cannot read the pressure, it shows the percentage used instead.

Page cache is the data your torrents and transfers recently read or wrote, kept in memory so the next read is fast. It counts toward your account's memory, which is why the bar can sit near full on an account that is short of nothing. When a program needs memory, the kernel drops cache first: the Linux kernel documentation for the memory controller says that a group of processes over its limit first has memory reclaimed from it, and only if that fails is a process stopped. A seedbox that moves a lot of data usually shows a large grey part, and that is the normal state.

What the pressure word means

The panel compares process memory with the hard limit your account runs under. That limit is currently set a quarter above the plan RAM the tile shows, and at most 2 GB above it, so the tile's bar can reach full before the server stops anything.

Word What the panel saw What to do
low Process memory under 80% of the hard limit (on most plans, below your plan's RAM), and no out-of-memory stop in the last day Nothing.
medium Process memory at 80% of the hard limit or more (on most plans, about your plan's RAM or above) Nothing urgent. Check what is running if it stays there.
high Process memory at 95% of the hard limit or more, or a program in your account was stopped for running out of memory in the last day Check what was stopped and why (below), then follow the options in Why is my seedbox using so much RAM, and what can I do?

The alert RAM limit exceeded appears at the top of the Welcome page when process memory is above your plan's RAM, with the text "Processes may be killed (OOM) until memory usage drops." That one needs action: your programs are using more than the plan has, and if they reach the hard limit with no cache left to drop, a program is stopped.

The tile and htop show different things. The memory bar at the top of htop counts the whole server, which many accounts share, so it says nothing about your own limit. The per-process memory column in htop is your own programs and is much closer to the tile's big number.

Checking from SSH

The panel reads process memory and cache from your account's own memory controller files, and you can read the same files over SSH. This prints your process memory (total_rss), page cache (total_cache) and, if the server reports it, program memory moved to swap (total_swap) in MiB:

awk '/^total_(rss|cache|swap) /{printf "%s %.0f MiB\n", $1, $2/1048576}' /sys/fs/cgroup/memory/user.slice/user-$(id -u).slice/memory.stat

This counts how many times a program in your account was stopped for running out of memory since the server last restarted. The pressure word only reflects a stop from the last day; this count goes further back:

grep -rh '^oom_kill ' /sys/fs/cgroup/memory/user.slice/user-$(id -u).slice --include=memory.oom_control | awk '{s+=$2} END {print "out-of-memory stops:", s+0}'

Run the second command even when the first shows mostly cache. A program that ran out of memory an hour ago has already been stopped, and the cache that refills the space after it makes the account look healthy now. A count above zero means look at what you run, whatever the grey bar shows.

When the memory is really yours

If process memory is close to your plan's RAM, or the stop count is above zero, the usual cause is a few memory-heavy programs running at the same time: Docker containers, deduplicating backups with a large repository such as Borg or restic, database dumps, or a media library scan on top of many active torrents. Rootless DOCKER covers stopping containers you no longer need, and Restarting rTorrent covers restarting rTorrent cleanly if it was stopped.

Why is my seedbox using so much RAM, and what can I do? lists the remedies: run fewer heavy jobs at once, add Extra RAM from your control panel's Upgrade Options, or move to a plan with more RAM. If the tile shows mostly grey, "pressure low" and no stops, none of that is needed.

The Welcome page and the files it reads are part of PMSS, Pulsed Media's open-source seedbox software, so the way each number is worked out can be read in its source code.

Pulsed Media's M1000 seedboxes run the same Welcome page and Memory tile on RAID5 storage and 1 Gbps networking, with 2 GB of RAM on M1000 S up to 7 GB on M1000 XL, and extra RAM can be added to any of them from the client area. M1000 S starts at 6.99€ a month excl. VAT on monthly billing, with a 14-day money-back guarantee on the first order. See the M1000 plans.

See also