RAMDISK setup correctly, but not working

#1

I’ve setup a Minecraft server on a spare computer to play with some friends. But it didn’t give me the performance I was hoping for. I read about ramdisk and since the computer has 4 GB ram, I thought it would be a good option.
I followed a tutorial which said I had to add a line of code to the file /etc/fstab. I added the following

tmpfs           /home/mc/servers tmpfs  rw,relatime,size=204800k           0     0

To verify I ran ‘mount’ and ‘df -h’ in the terminal. Which gave the same result as in the tutorial.

# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           385M  7.7M  377M   2% /run
/dev/sda2        93G  2.8G   86G   4% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /home/mc/servers

and

# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=1955984k,nr_inodes=488996,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=393584k,mode=755)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=616)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tmpfs on /home/mc/servers type tmpfs (rw,relatime,size=204800k)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)

The entries did get the right name, path and size, but the problem is that available space for /home/mc/servers will always be 200M and I do not notice any difference in performance. Besides that I find it strange that the total amount of tmpfs is more than 4 GB.

#2

The available space will always be 200M, but that is changable in your /etc/fstab:

tmpfs /home/mc/servers tmpfs rw,relatime,size=204800k

I don’t think that the total amount of tmpfs is a meaningful number to be concerned about, imo.

Mostly, I don’t think ramdisks are relevant anymore, so being able to notice performance increases from the outset seems unlikely. Lots has changing in the design of Minecraft that make it less useful–cheaper RAM, use of SSDs.

Spinning disks are where it would be most impactful, but even then, since I wrote up the RAMDISK page, Mojang also implemented MCRegion files, which greatly reduced HDD IO and again making ramdisks less and less significant.