D Darkless Help
Open the portal

Help Running your server Care and troubleshooting

My server is slow, out of memory or out of disk

Find what's using the CPU, memory or disk, read the logs for what went wrong, clear space safely, and know when it's time to upgrade.

4 min Updated 7 Nov 2026 Ubuntu, Debian, AlmaLinux

A slow server is almost always one of three things: the CPU is busy, the memory has run out, or the disk is full. Each takes a minute to check. Too busy to log in over SSH? Use the browser console.

The commands, at a glance#

CommandWhat it showsWorth worrying about when
uptimeLoad average over 1, 5 and 15 minutesIt stays above the number from nproc
nprocHow many CPU cores you have-
topPrograms, busiest firstOne program sits at the top for long
free -hMemory in use and availableavailable is near zero
df -hSpace on each disk/ is at or near 100%
df -iFiles on each disk (inodes)IUse% is at 100%
systemctl --failedServices that stopped when they shouldn'tAnything is listed
journalctl -p err -bErrors since the last bootThe same error keeps coming back

What's using the CPU and memory#

top

While it's open, press P to sort by CPU, M by memory, 1 to see each core, and q to quit. In the %Cpu(s) line, a high wa means programs are waiting on the disk, not the CPU.

htop is easier to read. Install it with sudo apt install -y htop, or on AlmaLinux sudo dnf install -y epel-release && sudo dnf install -y htop.

Out of memory#

free -h

Read available, not free: Linux fills spare memory with a file cache and hands it back when a program needs it.

When memory runs out completely, the kernel stops a program to save the rest, often your database or app. Check whether it has:

sudo journalctl -k --no-pager | grep -iE 'out of memory|killed process'

Then:

  • Find what's growing with top (press M). Restarting a leaking app buys time.
  • Turn down memory settings in databases and Java apps, which take what they're told to.
  • Add a swap file as a cushion for short spikes.
  • If it's simply too much work for the plan, upgrade (below).

Out of disk#

df -h

At 100% on /, programs can't write and fail in odd ways. Find what's big, a folder at a time, biggest last:

sudo du -xh --max-depth=1 / | sort -h

Then go into the biggest, such as /var. ncdu does this interactively: sudo apt install -y ncdu, then sudo ncdu -x /.

The usual suspects

WhatSee how muchClear it
System journaljournalctl --disk-usagesudo journalctl --vacuum-size=200M
Update packages (Ubuntu / Debian)du -sh /var/cache/aptsudo apt clean && sudo apt autoremove -y
Update packages (AlmaLinux / Rocky)du -sh /var/cache/dnfsudo dnf clean all && sudo dnf autoremove -y
Docker images and build cachesudo docker system dfsudo docker system prune
Old logs and backupssudo du -sh /var/logDelete old files by hand, never a running program's current log

docker system prune asks first and leaves running containers and volumes alone. To cap Docker's logs, see Install Docker and Docker Compose.

Space that doesn't come back

If you delete a big file and df doesn't change, a running program still has it open. Find it:

sudo find /proc/*/fd -ls 2>/dev/null | grep '(deleted)'

The number after /proc/ is the program's process ID. Restart that program and the space comes back.

If df -h shows space but you still get "disk full", run df -i: millions of tiny files (a cache, a session folder) can use up every inode. Clear that folder out.

Read the logs#

One program's log, in the last hour:

sudo journalctl -u caddy --since "1 hour ago" --no-pager

When to upgrade#

Move up when, under normal use, available memory stays low, the load sits above your core count most of the day, or the disk keeps filling with data you need. On a VPS, an upgrade keeps your files and restarts the server once: see Upgrade your plan.

Still slow and none of this explains it? Open a ticket and tell us what you've checked.

Still stuck? Open a ticket and say which guide you followed.