Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
more tmpfs info
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
rbr28
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2004
Posts: 126

PostPosted: Sun Jun 20, 2010 9:56 pm    Post subject: more tmpfs info Reply with quote

I'm using tmpfs for some stuff on a machine with an SSD and I have some questions I haven't seen answered in the documentation I've found.

1. If I have three partitions mounted w/ tmpfs and set a limit of 1GB for each, does that mean that each individually could use 1GB for a total of 3GB? If that's the case, is there a way to set the maximum total amount that can be used by all tmpfs mounts. As an example, I may want all three partitions to be able to use up to 1GB each, but to limit the combined total to 2GB.

2. I've seen reference to the fact that a tmpfs mount does not use much memory if no files are there. Anyone have any idea what the resource usage is for an empty tmpfs mount? Is there some amount of space reserved for any mount, like a small percentage of the limit or something? I'm just wondering if there's any advantage at all to setting the limit on the low side. Am I saving any resources whatsoever if I set the limit to 512M instead of 2GB for example?

3. Right now I have /var/run, /var/lock, /var/tmp/portage, and /tmp using tmpfs, and I'm wondering if there are any other reasonable possibilities.

Thanks,
Vern
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sun Jun 20, 2010 10:34 pm    Post subject: Reply with quote

1. The limits specified are per each mount, so 3 1GB mounts could at most hold 3GB. You could of course limit the total to 2GB if your system only has 2GB, but this is probably not what you want :) I don't know of a good way to set a total limit - even disk quotas I believe are be per-filesystem. Newer kernels have various cpu/process/etc group features that I don't understand in the least, maybe it could be worth looking into them.

2. The overhead for an empty tmpfs is constant and not related to the maximum limit as far as I know. It's small enough to be ignored. The limits are there mostly to prevent a tmpfs from running out of control and consuming all the RAM (and swap?).

3. This depends on your usage and amount of RAM available. You could load your entire system into tmpfs if you have enough memory and don't mind waiting for it to fill at boot. Chances are /var/tmp/portage is the only one of your examples that will give a meaningful performance difference, but in the case of an SSD system, /tmp will slightly reduce write count (/var/run is usually only written to when services start, and on the kubuntu machine I'm on at the moment, /var/lock isn't used at all).
Back to top
View user's profile Send private message
Section_8
l33t
l33t


Joined: 22 May 2004
Posts: 627

PostPosted: Mon Jun 21, 2010 3:43 pm    Post subject: Reply with quote

As BradN said, I think each tmpfs mount limit in fstab applies to each mount individually. tmpfs is just a ramdisk in virtual storage instead of physical ram, so the total max tmpfs size is the amount of virtual storage (ram + swap) you have free. However, if you fill up physical ram with tmpfs and it starts swapping, that kind of defeats the purpose.

If you have a 1 gig limit on /var/tmp/portage, that's not enough for some packages. Openoffice takes about 7 gig, I think. If you don't want to make /var/tmp/portage that big, you can just umount /var/tmp/portage before emerging openoffice (assuming you /var partition has enough free space).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum