Re: Moving /tmp to tmpfs makes it useless
- To: Henrique de Moraes Holschuh <email@example.com>
- Cc: Thomas Goirand <firstname.lastname@example.org>, email@example.com
- Subject: Re: Moving /tmp to tmpfs makes it useless
- From: Goswin von Brederlow <firstname.lastname@example.org>
- Date: Fri, 01 Jun 2012 12:50:26 +0200
- Message-id: <email@example.com>
- In-reply-to: <20120525101420.GA6872@khazad-dum.debian.net> (Henrique de Moraes Holschuh's message of "Fri, 25 May 2012 07:14:20 -0300")
- References: <CAOVenEo+CT6Ou_vHq8HvuCz1NdW0Ogq5UqxMZh-4Qkw4e01CsA@mail.gmail.com> <20120525003051.GA1497@jwilk.net> <firstname.lastname@example.org> <CAOVenEqx1VLBmn4eJdFJ29PUj5ebJp9DHrMea7gprF8+GZd5Fg@mail.gmail.com> <4FBF16A3.email@example.com> <20120525101420.GA6872@khazad-dum.debian.net>
Henrique de Moraes Holschuh <firstname.lastname@example.org> writes:
> On Fri, 25 May 2012, Thomas Goirand wrote:
>> for small files, and in that case, it's faster. In reality, it's
>> not that much faster, thanks to Linux caching of the filesystem,
> Under heavy filesystem IO load, yes it is. By several orders of magnitude.
Even without load it is much faster because fsync() becomes a NOP. Disk
based filesystems add sequenze points where you have to wait for the
disk to catch up before continuing while tmpfs does not.
It also saves on wear of the disk if the files are small and short
lived, like temp files for gcc. No point writing the file to disk if it
gets deleted 10s later.
>> the point. Maybe we should add a /small-files-on-tmpfs (choose
>> a better name, of course...) folder so that apps know what to do,
>> that'd be a lot more graceful than just switching to whole /tmp
>> to tmpfs without any app knowing about it.
> Nice idea, but it would be worthless.
> In fact it is the other way. We have /var/tmp for the large file since
> about forever, and important platforms that have /tmp in memory since the
> early 2000's (Solaris)....
> And that STILL wasn't enough for people to not screw it up and dump large
> files in /tmp.
There is also no problem with having large files in tmpfs. Only
requirement is that you make tmpfs large enough and add enough ram
and/or swap to cope with it.
All the complaints about /tmp as tmpfs come down to one simple issue:
The size of the tmpfs isn't chosen well. It would be more constructive
to find a better heuristic for the size there.