Pretty straight forward.
First important is to check which user / group has the current permission, no point of loading a ram drive if magento can’t write to it.
Should give you a basic view of the current owner.
Now, we can create our tmpfs drives.
mount -t tmpfs -o size=128m tmpfs /home/magento/var/cache/
chown user:group (in mycase nobody:nobody) /home/magento/var/cache chmod o+w /home/magento/var/cache
Perform the same for /var/sessions
Their you go, you now have a SuperFast MageCache :-)
Only downside if you reboot you shall have to remount them, otherwise you can add them to you /etc/fstab