Re: Moving /tmp to tmpfs makes it useless
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