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

Re: Idea: mount /tmp to tmpfs depending on free space and RAM



On 15/06/2012 03:11, Serge wrote:
> 2012/6/13 Jean-Christophe Dubacq wrote:
> 
>>> Why do people repeat that tmpfs is easy to resize? Yes, you need about 3
>>> commands to resize tmpfs, but you need 0 (zero!) commands to resize /tmp on
>>> disk, because it's large by default and you don't need to resize it. It's
>>> easier to NOT resize /tmp on disk then resize /tmp on tmpfs, isn't it? ;)
>>
>> Obviously, you only think of /tmp as mounted on /.
> 
> It was about /tmp on disk in general, but as long as default is to have
> everything on a root partition - it does not matter where exactly it is.
> For more complex configurations I suggested several "Alternatives"
> (e.g. mount-bind to /home/tmp), each of them is usually better than tmpfs,
> and don't need tmpfs-like resizes.
> 
>> This is often seen as not a good move to have a user-writable directory on
>> the system partition(s), since this provides for easy DOS
> 
> DoS like what? /tmp on disk have a 5% safety limit available for system,
> user can "DoS" only his own processes, and he can do that anyway. But
> /tmp on tmpfs is even worse move, since it does not have 5% safety.

1) With 2TB disks, I certainly do not use 5% any more
2) Mysql, apache, postfix, all kind of vital systems, do not run as
root. And if /tmp is full (and mounted on /), / is full (and so is
/var). All kind of mayhem may happen there (I have seen it).

>> (even involuntary; I know of people daily working with 30GB files, and
>> this easily fills the / partition).
> 
> Is there anything better for them than /tmp on disk? If it's a desktop with
> single disk I would suggested them a single root partition (with /tmp on it).
> If it's a server with small root but large /home on RAIDs then I would
> mount-bind /tmp to /home/tmp...

Learning not to use /tmp to place large files. Setting TMPDIR=/home/tmp
is a start, indeed.

Sincerly,
-- 
Jean-Christophe Dubacq

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: