To add a new tmpfs mount in a specific location:
mkdir -p /path/to/directory/
mount -t tmpfs -o size=512M,mode=0744 tmpfs /path/to/directory
and then add the following to /etc/fstab:
tmpfs /path/to/directory tmpfs size=512M,mode=0777 0 0
The potential returns this can give something like your session (if you’re still using files and not, say, memcache) or cache files is pretty significant. As always, test in your own environment before rolling out into production. And in case you weren’t aware, a reboot will wipe the contents of that folder…after all, it is a ram disk, not actual file storage.
To grow the size of an existing tmpfs:
mount -o remount,size=2G /path/to/directory
And don’t forget to modify /etc/fstab if you want it to be permanent!