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

Re: how to increase space for tmpfs /tmp



On 3/24/2012 4:02 PM, Javier Vasquez wrote:
> 2012/3/24 shirish शिरीष <shirishag75@gmail.com>:

>> # 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.

That's probably not a smart idea:

http://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt
...
tmpfs has three mount options for sizing:

size:      The limit of allocated bytes for this tmpfs instance. The
           default is half of your physical RAM without swap. If you
           oversize your tmpfs instances the machine will deadlock
           since the OOM handler will not be able to free that memory.
...

The OP would likely be far better off simply mounting /tmp on his root
filesystem as was always done in the past.  Application developers
writing to /tmp aren't expecting memory speed transfers of such files
because of the traditional placement of /tmp.  And he'll have more than
enough space, many times his RAM quantity.

FWIW, my Squeeze servers are all upgrades going back to Sarge, IIRC.
Here's my /tmp setup:

$ df /tmp
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda2     ext2     33G  3.8G   28G  12% /

I'm sure some/many of you will gasp at that fact I still use EXT2.  If
it ain't broke, don't "fix" it.  The /boot and root filesystems are on
EXT2, with all data storage on XFS.  Never had problems with EXT2 in
this setup, so it lives on, for now.

-- 
Stan


Reply to: