Live data from Hacker News

Tmpfs considered harmful

rwmj.wordpress.com

41–50 of 85 posts

Re: Tmpfs considered harmful

#41
post #25

Earlier quoted context omitted.

That's why the GP considers mutt broken. Drafts should be stored in ~/.mutt or /var, not /tmp. Files in /tmp should not be expected to survive a process.

This is exactly the point of the posting. Every program has to be examined for this problem, and it forces a complex decision about the storage hierarchy onto every programmer.

That's like saying "RAM considered harmful", because every time a developer has to think "do I just store this in memory, or do I sync it to disk" "it forces a complex decision about the storage hierarchy": /tmp is simply RAM that has the API of a file; it used to be implemented using a horrible kludge with files on disk that were periodically deleted, but with tmpfs the dream became a reality.

Re: Tmpfs considered harmful

#43
post #4

Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot" I believe there was never such expectation of /tmp. On many systems it's being wiped periodically or even when the user's last session ends. The example app(s) that use /tmp for drafts need(s) to be fixed.

I remember myself creating cron jobs to free wasted /tmp space

Re: Tmpfs considered harmful

#44
post #21
post #9

Earlier quoted context omitted.

This is exactly what I use it for on my desktop. I have any app that I don't want to maintain longterm history for it's internal files (ex: Firefox browser cache) pointed to /tmp (mounted as tmpfs). As an added bonus if you're running your OS on an SSD (which you should be) you don't have it thrashed by constant writes/deletes. The memory size issue is basically a non-issue at this point (pair of desktop 16 GB DIMMS…

The memory size issue is very much still an issue. I happen to have globs of memory on my machine, but for the very reason that I have software to use it. If large tmp files start eating into the resources available to my programs, its an issue for me. Also, older hardware that has less memory available, and even newer hardware that can have more memory installed but with non-tech users who don't know how to upgrade…

If it's an issue for you, you can simply umount the tmpfs and remove the entry for fstab. I think this is a good default - on all mystems these days, it's disk-io that's the killer, not running out of memory.

Re: Tmpfs considered harmful

#45
post #25

Earlier quoted context omitted.

That's why the GP considers mutt broken. Drafts should be stored in ~/.mutt or /var, not /tmp. Files in /tmp should not be expected to survive a process.

This is exactly the point of the posting. Every program has to be examined for this problem, and it forces a complex decision about the storage hierarchy onto every programmer.

Every program has to be examined for this problem anyway, tempfs or otherwise, so I don't get the point.

Re: Tmpfs considered harmful

#46
post #25

Earlier quoted context omitted.

That's why the GP considers mutt broken. Drafts should be stored in ~/.mutt or /var, not /tmp. Files in /tmp should not be expected to survive a process.

This is exactly the point of the posting. Every program has to be examined for this problem, and it forces a complex decision about the storage hierarchy onto every programmer.

Every program has had to be designed with this in mind for decades or be broken on any number of systems. This may be new behaviour for Fedora, but it's not a new thing on Linux, or for Unix-like systems in general.

It's not just systems that delete on reboot, but also systems set up with cron-jobs to regularly wipe /tmp, or sysadmins that will (rightfully) see /tmp as something that can be wiped at pretty much time.

Re: Tmpfs considered harmful

#47
post #40
post #23

Oh, i hope they revert this change! The big trouble for me would be "Everyone must now be careful never to store a file in /tmp that might grow large". I often use /tmp for all kinds of temporary storage. Be it a small text file or a GB big tar file.

Rare use case... I remember CD burning softwares and torrent clients asking for special temp directories to be used for that. Allowing every day applications to create GBs of tmp files would mean you would need to worry once your partition has less than 100 GB free. However, nobody stops you from mounting /tmp anywhere else or even disable tmpfs.

Very common for me, not so common for you. ;) And: when is use /tmp on my laptop, it gets cleared after reboot, so that's perfect for _temporary_ files..

Re: Tmpfs considered harmful

#49
The fact is, is that not every app that uses /tmp does so in a safe manner.

As long as that is true, it's not a good idea to use tmpfs for /tmp.

It's perfectly reasonable, however, to use tmpfs for, say, /var/local/tmp and let individual users point $TMP at that. Want to live fast and dangerously? Set $TMP.

Post reply on HN