You are not logged in.

#1 2012-11-01 17:09:07

dlind
Member
Registered: 2010-07-27
Posts: 18

[SOLVED] Multiple tmpfs, good idea?

Hi,

So I've decided to put some directories into a tmpfs, just for the heck of it. Is this in any way a bad idea? Is there a better way to put directories into RAM besides tmpfs? I currently have 16GB of RAM available, so it would be nice to utilize it by putting caches and stuff into it.

df -h
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
tmpfs           7.9G  124K  7.9G   1% /var/log
tmpfs           7.9G  8.0K  7.9G   1% /tmp
tmpfs           500M     0  500M   0% /home/david/.cache/uzbl
/etc/fstab
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
tmpfs		/var/log tmpfs defaults,noatime,mode=0755,size=2G 0 0
tmpfs		/home/david/.cache/uzbl tmpfs defaults,noatime,size=500M,uid=1000,gid=100 0 0

Last edited by dlind (2012-11-01 19:50:36)

Offline

#2 2012-11-01 17:32:20

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Multiple tmpfs, good idea?

I see no reason why that would not be okay, other than the obvious non-persistent logs and non-persistent browser cache.  So fi you are okay without saved cookies or error messages, I cannot think of why you wouldn't be okay doing this.  /tmp has been on a tmpfs for some time now as the default in Arch Linux... so that is fine as well.  Just don't do massive compilation in /tmp and you should be a-okay.

One thing to note is that yout size=2G and size=500M are not entirely necessary.  Tmpfs defaults to half of your ram (collectively), so unless you are trying to stem runaway caching or logging, you probably don't need this.  But even then I think filling the tmpfs will lead to other problems, as it probably won't just fill the 2GB and then just go "oh okay, no more room... I guess I'll just stop now."  There are proabbly going to be far more dire consequences.

Offline

#3 2012-11-01 18:05:05

dlind
Member
Registered: 2010-07-27
Posts: 18

Re: [SOLVED] Multiple tmpfs, good idea?

Thanks for the answer!

It seems that this is a perfectly fine solution then. :-)

I think that if the tmpfs gets maxed out it will turn to the swap-space allocated on the harddrive, not completely sure though.

Offline

#4 2012-11-01 18:15:33

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Multiple tmpfs, good idea?

No it will not.  It will simply fill up and then fail to write more.  If you want it to go to swap, you have to allot more than the default.  So for instance, I have 8GB, and if I want it to swap stuff out, I should put 10GB, so that when it really does run out of usable space, it will then push stuff out the the swap space.  the space= is really a hard limit, and it will not go any larger than that whatsoever.

Offline

#5 2012-11-01 19:00:49

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: [SOLVED] Multiple tmpfs, good idea?

The stuff in tmpfs itself IS actually swapped out when needed, but this is a function of overall RAM use, not that of the tmpfs.

If you're looking at sticking browser caches and the like on a tmpfs, you might want to look at something like anything-sync-daemon or similar.

Offline

Board footer

Powered by FluxBB