You are not logged in.

#1 2024-07-24 23:44:06

bedtime
Member
Registered: 2019-02-12
Posts: 74

Linking directories to tmpfs directories [solved]

Since I'm an SSD, I'm looking to reduce its IO as much as possible.

Would it be of any benefit to link these directories as indicated below?

ln -s /run/user/1000/ /home/$USER/.cache
ln -s /tmp /var/log
ln -s /tmp /var/tmp

I've done this very thing, and things seem to be working fine—storing in ram instead of on disk—but I don't know if this is a good idea, so I'm looking for some input.

Initially, I had mounted these directories as tmpfs in /etc/fstab, but I was thinking that linking them might be a more versatile way to do it.

Last edited by bedtime (2024-07-25 17:34:09)

Offline

#2 2024-07-24 23:50:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,105
Website

Re: Linking directories to tmpfs directories [solved]

bedtime wrote:

Since I'm an SSD, I'm looking to reduce its IO as much as possible.

Those two have nothing to do with each other unless you inherited an ancient SSD.  With modern SSDs the concern with IO wear is less than with most typical HDDs: as in it's pointless to worry about.  There is no benefit.

While the directories you placed may work in tmpfs, there's no benefit and there are potential costs.  First, you lose your entire cache every reboot which means you are retrieving the same data repeatedly.  Second, you'll lose all of your logs including the journal - this is a horrible idea if you ask me.  There should be no harm from moving /var/tmp, but again, still no benefit.

Last edited by Trilby (2024-07-25 12:26:19)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2024-07-25 07:13:28

seth
Member
Registered: 2012-09-03
Posts: 56,103

Re: Linking directories to tmpfs directories [solved]

1. You're gonna litter /tmp w/o any subdirectories and might run into collisions
2. You're gonna use up the tmpfs memory quota for that mount
3. Check the mountpoint for stale data - anything that opens a file before the tmpfs is mounted will just happily access the mountpoint inodes on your SSD. It's not very likely but then at least you know.

https://wiki.archlinux.org/title/Improv … ads/writes

Offline

#4 2024-07-25 15:51:08

bedtime
Member
Registered: 2019-02-12
Posts: 74

Re: Linking directories to tmpfs directories [solved]

Trilby wrote:
bedtime wrote:

Since I'm an SSD, I'm looking to reduce its IO as much as possible.

Those two have nothing to do with each other unless you inherited an ancient SSD.  With modern SSDs the concern with IO wear is less than with most typical HDDs: as in it's pointless to worry about.  There is no benefit.

While the directories you placed may work in tmpfs, there's no benefit and there are potential costs.  First, you lose your entire cache every reboot which means you are retrieving the same data repeatedly.  Second, you'll lose all of your logs including the journal - this is a horrible idea if you ask me.  There should be no harm from moving /var/tmp, but again, still no benefit.

Thanks. I ended up just removing those links and not having those directories in tmpfs. I don't really notice any speed difference anyways.


Seth,

Thanks. I'm gonna check that link out that you gave me and put that to use.

Seems like once again I was trying to fix an issue that didn't exist, lol.

Offline

Board footer

Powered by FluxBB