Live Blog

Increasing /run Ramdisk tmpfs on Ubuntu

This page has had its content updated on October 21, 2025 EDT by Jordan

Content Error or Suggest an Edit

Notice a grammatical error or technical inaccuracy? Let us know; we will give you credit!

Introduction

This live blog entry is specific to GridPane mostly, but can be use for other platforms that use Linux or specifically Ubuntu. You might have seen the following message when from monit which is deployed on GridPane servers.

[2025-01-14T15:13:07-0500] error    : 'run_ramdisk_usage' status failed (1) -- /run ramdisk warning | tmpfs           3.2G  3.1G  129M  97% /run

If you take a look at your mounted filesystems by running ‘df’ you will see /run is taking up 97% disk space.

❯ df -h                                                                                                                                                                                  
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.0G  2.9G  3.0G  97% /run
/dev/vda2       469G  211G  238G  47% /
tmpfs            16G  568K   16G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            16G  5.1M   16G   1% /tmp
/dev/vda1       511M  6.1M  505M   2% /boot/efi
tmpfs           3.2G  4.0K  3.2G   1% /run/user/0
tmpfs           3.2G  4.0K  3.2G   1% /run/user/1002

You can use the command du or ncdu (can be installed via apt-get install ncdu) to see the directories sizes to find out what is using the most space.

❯ du . --max-depth=1 -h                                                                                                                                                                 
0       ./needrestart
4.0K    ./redis
0       ./motd.d
0       ./nginx-proxy-cache
2.9G    ./nginx-cache
0       ./sshd
4.0K    ./netdata
4.0K    ./mysqld

As you can see, the nginx-cache folder is taking up a considerable amount of space. This is to be expected if you’re using Nginx fastcgi for PHP caching. The following nginx config within GridPane utilizes the /run folder.

fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=FASTCGICACHE:100m max_size=6045m inactive=7d;

The /var/run directory is a symlink to /run in this instance.

What is tmpfs?

The tmpfs filesystem is a temporary filesystem in Linux (including Ubuntu) that stores files in volatile memory (RAM) instead of on a persistent disk. It is often used for storing temporary files that do not need to be retained after a system reboot.

Files stored in tmpfs are faster to access compared to traditional disk storage since they reside in memory. However, since it uses RAM, the storage capacity is limited by the amount of available memory.

A common use of tmpfs is for directories like /tmp or /run, which typically hold temporary system or application files.

Resolution

1 – Increase /run

Attention

Make sure that you have enough system memory to allow for a 6GB tmpfs partition, as it uses the systems memory. If there is no system memory available, then swap will be used which is slower.

The resolution is actually pretty straight forward, since it looks like we’re running out of space for Nginx fastcgi cache, we need to increase the /run tmpfs file system. You can run one command to extend the /run partition which is using tmpfs.

The following command, will change the size of the /run partition to 6G and remount it. No restart is required of the system or Nginx service.

mount -o remount,size=6G /run

You should then see an increase of the /run partition through df as seen below.

❯ df -h                                                                                                                                                                                  
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           6.0G  3.1G  3.0G  51% /run
/dev/vda2       469G  211G  238G  47% /
tmpfs            16G  568K   16G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            16G  5.1M   16G   1% /tmp
/dev/vda1       511M  6.1M  505M   2% /boot/efi
tmpfs           3.2G  4.0K  3.2G   1% /run/user/0
tmpfs           3.2G  4.0K  3.2G   1% /run/user/1002

2 – Decrease Nginx fastcgi_cache_path max_size

Another solution is to decrease the fastcgi_cache_path option max_size to be under the warning amount of the monit trigger which is 96%

cropped GridPane Self Managed WordPress Hosting
Configure Nginx | GridPane
Worker Configurations Server Name Configurations Limits Configurations Open File Cache Configurations FastCGI Configurations Proxy Configurations Limits…
Gridpane Favicongridpane.com

You would run the following command

gp stack nginx fastcgi -max-cache-size 2700

3 – Change Nginx fastcgi_cache_path storage location (Disk versus Memory)

Another option, that isn’t possible in GridPane would be to change the fastcgi_cache_path to another location that is slow than memory. Such as fast NVMe disk, this would be appropriate if you had a bare-metal server with NVMe storage.

The following is the Nginx config, and you can see /var/run/nginx-cache which could be changed to /var/nginx-cache which would be on the local disk.

Just be aware that ramdisk (ram that is used as storage) would be faster than using disk based storage, but with the speeds of NVMe this would allow for a larger cache if you have issues with your cache filling up.

fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=FASTCGICACHE:100m max_size=2700m inactive=7d;

You could also stop nginx and then symlink /var/run/nginx-cache to /var/nginx-cache which would work on the GridPane platform but since /var/run is wiped on reboot you would have to re-instate it and restart nginx. Which can become problematic.

Changelog

  • 10/21/2025 – Updated title to remove partition, split resolution into two.

0 Shares: