I’m running 12.1 in 8gb ram.
How can i mount the system temp folder in ram?
I found this “tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0” on the net.
Do i simply add it in fstab? How can i check if it is working?
Thank you.
Yes, just add that to fstab. It will start working after the next boot.
To check that it is working, just look at the output of “df”. You should see it there.
Note: The files that were previously in “/tmp” will still be there, underneath the mounted “/tmp”. You won’t be able to see them or access them, but they will still take up space. Once you are sure that your tmpfs mount is working, you can try removing those. I describe how to remove them at: Cleaning “/tmp”
You can use zram kernel module to make very fast compressed drives in ram (including swap).
About 3,5GB/s average read speed using only one core on my desktop and 0.0ms access time.
On Wed, 11 Jan 2012 17:16:03 +0000, sobrus wrote:
> You can use zram kernel module to make very fast compressed drives in
> ram (including swap).
Don’t know what that would achieve, though, since the purpose of swap is
to page out of active memory. By making a ramdisk and using it for swap,
you’d effectively increase swappiness by reducing overall RAM available
to the system.
Jim
–
Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C
I have added the line and this is my df exit
devtmpfs 4082900 36 4082864 1% /dev
tmpfs 4089364 0 4089364 0% /dev/shm
tmpfs 4089364 652 4088712 1% /run
tmpfs 4089364 0 4089364 0% /sys/fs/cgroup
tmpfs 4089364 0 4089364 0% /media
tmpfs 4089364 652 4088712 1% /var/lock
tmpfs 4089364 652 4088712 1% /var/run
tmpfs 4089364 52 4089312 1% /tmp
Does this mean that tmp is in ram? Is it possible to adjust the maximum size of the tmp?
I had already added in cron job to clear tmp folder.
Thank you very much for your response.
Yes, though it will overflow into swap if it gets big.
I am using “size=100m” in the options field of the fstab entry. That limits how large it can get.
Your “/tmp” will be automatically cleared on reboot. In my case, I reboot often enough that I don’t need a cron job to clear it.
zram or compcache is a kernel feature that came from low memory android devices.
zram device is LZO compressed typically around 5:1 ratio, and it is orders of magnitude faster than HDD.
On low memory systems it makes HUGE difference, as amount of data stored in memory using 25% zram is typically almost doubled (the downside is increased cpu usage).
When zram limit (set by user) is reached, system will start paging out to lower priority swap (HDD).
Yes it would have no effect on 8GB RAM unless you are doing some very memory intensive work,
But it would be probably better to make ext4 zram device and mount it as /tmp than to use uncompressed memory.
Here is complete guide:
Compressing RAM with zRam
You need to replace mkswap+swapon with proper mkfs+mount command.
Please note that num_devices option has been replaced with zram_num_devices starting from kernel 3.2
I will give it a shot at my 2nd pc with 2gb ram.
Thank you all for your quick response.
Problem solved.