Re: Moving /tmp to tmpfs makes it useless
- To: Vincent Danjean <firstname.lastname@example.org>
- Cc: 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 13:22:06 +0200
- Message-id: <[🔎] email@example.com>
- In-reply-to: <4FBF38DD.firstname.lastname@example.org> (Vincent Danjean's message of "Fri, 25 May 2012 09:46:37 +0200")
- References: <CAOVenEo+CT6Ou_vHq8HvuCz1NdW0Ogq5UqxMZh-4Qkw4e01CsA@mail.gmail.com> <email@example.com> <4FBF38DD.firstname.lastname@example.org>
Vincent Danjean <email@example.com> writes:
> Le 25/05/2012 05:03, Russell Coker a Ã©crit :
>> On Fri, 25 May 2012, Serge <firstname.lastname@example.org> wrote:
>>> Q: /tmp on tmpfs increases apps performance.
>>> A: What apps? Real apps don't write files during performance-critical
>>> operations. Even if they do, they write large files. And large files are
>>> written faster when they're written on real disk, rather then swapped
>>> out and slow down the entire system (see the "Who uses /tmp" part).
>>> The apps that can really benefit from tmpfs are too rare. And we're
>>> talking about default settings and most common cases.
>> Any application which writes synchronously (through fsync(), fdatasync(), or
>> opening with O_SYNC) will get a massive performance benefit from using tmpfs.
> If some kind of sync is required by the application, I think this is
> because the application want to ensure the data are really written to
> the disk so that their state remains coherent even in case of crash.
> If the application is ok to have this kind of data written to
> tmpfs (ie in memory), I do not see the interest of using sync at
> first. Can someone shows me a valid use case of sync on tmpfs?
You might also need to [fm]sync() to ensure the data written by one
application can be read by another, to ensure the state remains coherent
between multiple processes.
And don't forget that disk based filesystems add syncs internally to
ensure their own coherent state. Applications do get blocked by those