[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 Thu, Jun 07, 2012 at 03:24:08PM +0200, Wouter Verhelst wrote:
On Fri, Jun 01, 2012 at 07:00:52PM +0300, Serge wrote:
Well, nobody named the benefits yet.
- You could mount your mail spool there, and make things go blazingly
 fast [1]

If I remember Wietse’s opinion correctly he will jump on your throat if you put the postfix mail spool on tmpfs.

Maybe it could be used for amavis tmp directory, if you have enough RAM or small enough mails.

- It speeds things up, especially on systems with loads of RAM and no
 swapspace: whenever there's a possibility of disk access, no matter

It may do so, but how many Debian user have so much RAM and/or so less disk space, that it can be used as default (yes, luckily it was changed)?

- anything which reduces the number of possible disk accesses is good
 for people using SSDs (I have a laptop with SSD, and no swap, and love
 tmpfs for precisely that reason).

So, you have /var/log on tmpfs as well (or a remote log server)? Don’t you think that you are doing more writes to /var or $HOME than to tmp?

Besides SSDs aren’t so wide spread (and in my eyes too unsecure yet) that you should optimize for them as default.

- In the (on laptops and desktops) fairly common
 "one-partition-for-everything" set-up, there's no risk of a runaway
 process eating up your diskspace with huge files in /tmp and therefore

But runaway processes may fill your disk with log entries. I have seen a catalina.out with the size of several gigabytes.

- It makes for an interesting "I need to compile something quickly just
 to test something out" area, where it doesn't matter if you forget to
 clean up after the fact (yes, this is a bit of an abuse of /tmp; never
 the less, I find myself doing such things in /tmp fairly often now
 that /tmp is a tmpfs)

Probably true. The only thing I compile myself is the Linux kernel, and I want to keep it. But again, nothing that is worth as default installation.

- There's no danger of a symlink attack or similar with things like
 tmpreaper -- or indeed any need for tmpreaper anymore. You reboot the
 system, and /tmp is clean again, no matter what was there before. This
 is more than just a convenience.

The existance of TMPTIME shows that there are more than enough people who don’t want to loose the contents of their /tmp with every reboot. Besides tmpreaper exists so you clean your /tmp without the need to reboot.

There are certainly advantages of tmpfs, but I don’t see it in /tmp for most systems. But the installer may give you the choise (or create as standard) to have a /tmpfs with tmpfs, so every user who wants to use it, can set their own TMPDIR.

Shade and sweet water!


| Stephan Seitz          E-Mail: stse@fsing.rootsland.net |
| Public Keys: http://fsing.rootsland.net/~stse/keys.html |

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply to: