1

We have a production server with 4GB of RAM running Debian with webserver and various other applications. Checking from the command line using htop, about 3.7-3.8GB of the RAM is used at any given time.

The server is not showing signs of slowness or unresponsiveness. Is it fine to run a server like this at near 100% RAM utilization, or can some problems arise in the future?

Output of free:

              total        used        free      shared  buff/cache   available
Mem:        3957164     3108136      189128       22348      659900      567960
Swap:       4108284      143104     3965180

Here's a screenshot of the htop output: HTOP (usually RAM usage is higher, the server was rebooted recently)

HTOP output

rhw5
  • 90

1 Answers1

2

Approaching 0% available memory, the kernel will try increasingly drastic things to ensure some is available. Rapid paging out of RAM to storage can cause drastic slowdowns. The OOM killer reduces performance to zero when it kills processes. Still better than panicing and rebooting.

The key word is available memory. Linux will use any free memory it can for caches, which are automatically made available for allocation. Obligatory citation of the canonical FAQ: https://www.linuxatemyram.com/

htop there is reporting about 77% utilization and 1% page space use. Nice fully utilizing it, but the free output shows a few percent higher and its starting to swap. A couple GB more RAM, up to 6 or 8 GB maybe, would be a nice buffer. Especially if it is one your production boxes.

John Mahowald
  • 36,071