[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to increase space for tmpfs /tmp



2012/3/24 shirish शिरीष <shirishag75@gmail.com>:
>
> ...
>
> How do I write values of TMPFS_SIZE and TMP_SIZE
>
> This is what it looks like atm :-
>
> # TMPFS_SIZE: maximum size for all tmpfs filesystems if no specific
> # size is provided.  If no value is provided here, the kernel default
> # will be used.
> TMPFS_SIZE=20%

See, this is as you wish.  This particular setting is the maximum for
ALL of the tmpfs space.  Kind of the default if nothing else is
specified.  You might not touch this if you don't want.  So I would
not be afraid of using 100% of RAM here.  Though if you feel like it's
too agressive, you can set something different.

When using %, the percentage is with respect to RAM.

I would recommend you also looking at swappiness setting
(vm.swappiness), :-)  When you use absolute sizes, those sizes can go
beyond RAM, as long as they fit into RAM+Swap, that's why I mentioned
swappiness, though a bit off topic.

>
> # TMP_SIZE: maximum size of /tmp
> #
> # No default size.
> TMP_SIZE=

This is also as per your needs.  You might want to use all of the RAM
reducing if you'd like other tmpfs areas such as /run and /run/lock,
plus some margin.  Or you could use some other heuristic, more or less
conservative.

I would use half the RAM if I want to be conservative, :-).  And if
agressive, then whole RAM, hoping to swap when in need (I usually have
in swap same amount of RAM).

You can google around this, and you can find the following information
useful (though not debian):

https://wiki.archlinux.org/index.php/Fstab#tmpfs

Notice there's no restriction to go beyond RAM size again, since you
can always swap.

Finally, you do not need to touch /etc/default/tmpfs if you don't want
to.  Just set the entry in your /etc/fstab as I mentioned previously,
kind of:

tmpfs          /tmp            tmpfs   nodev,nosuid,relatime,size=2G   0       0

Just make sure the size you use doesn't exceed RAM+Swap...

>
> Now my questions are :-
>
> a. From where would TMPFS_Size be used ? Would it take from the space
> allocated from / (which has enough empty space) or does it take from
> /home. Note that I have two partitions / , /home and of course swap is
> also good around 4 GB.
>
> $ free -h
>             total       used       free     shared    buffers     cached
> Mem:          2.0G       1.8G       134M         0B        72M       840M
> -/+ buffers/cache:       954M       1.0G
> Swap:         4.6G       212M       4.4G
>

There's no magic, just experimentation.  I think I provided enough
hints, but from your setting:  2g RAM + 4.6g Swap, I would go with the
2g, or even 3g...  It doesn't mean you'll be using all that amount of
tmp area, it means you can load through vim a 2g or a 3g file if you'd
like, :-)  Vim by default loads in /tmp...

> b. The second question is how do I phrase the two ?
> tmpfs is given as 20% . 20% is default for what and from where ?

Didn't understand.  TMPFS_SIZE is kind of the default if no other
setting is found.  The rest are specific.

>
> c. What do I write at TMP_SIZE= if I want to say 900 MiB or 1 GiB .

Do the math, :-)  I believe you can use a suffix also.  But again, you
can always use fstab without touching debian stuff...

>
>
>> Thanks,
>>
>> --
>> Javier.

-- 
Javier.


Reply to: