po5 / thumbfast

High-performance on-the-fly thumbnailer script for mpv
Mozilla Public License 2.0
861 stars 35 forks source link

in default socket path does it use virtual memory? #38

Closed trappedinspacetime closed 1 year ago

trappedinspacetime commented 2 years ago

Thank you for making this script, I like it. I am running Ubuntu 22.04 Mate. I have 8GB of RAM and SSD storage. I care for health of my SSD's life span. I wonder if it uses RAM for preview images. If not, can I use /dev/shm/tmp directory path for rendering process?

christoph-heinrich commented 2 years ago

On linux it uses /tmp/ for it's files, which usually is usually in RAM.

If you want to make sure, check your /etc/fstab and look for the line that mounts /tmp. If it uses tmpfs, your SSD will be fine :wink:.

Here is what that line looks like in my fstab:

tmpfs                                     /tmp            tmpfs   defaults,noatime,mode=1777,size=7G 0 0

But you can also customize it with the socket and thumbnail options, if you would rather have them somewhere else.

trappedinspacetime commented 2 years ago

@christoph-heinrich Thank you for responding and the info. I checked /etc/fstab it doesn't have tmpfs entry. I decided to use /dev/shm/tmp directory for socket. I'm confused about thumbnail file path. What should I use for it regarding /dev/shm/tmp path?

christoph-heinrich commented 2 years ago

I'd say something this would make sense

socket=/dev/shm/thumbfast
thumbnail=/dev/shm/thumbfast.out

Those are the filenames that thumbfast uses by default for the /tmp/ directory.

trappedinspacetime commented 2 years ago

Thank you for your help. It works well. I hope you document it for other users. All the best.

teodor6140 commented 1 year ago

@trappedinspacetime

I checked /etc/fstab it doesn't have tmpfs entry.

Even if it's not in fstab, systemd has a service that sets up tmpfs, so /tmp is probably still using tmpfs. You should check with mount | grep tmp

trappedinspacetime commented 1 year ago

@teodor6140 Thank you for the suggestion. I am running Ubuntu 22.04 Mate.

      mount | grep tmp
      udev on /dev type devtmpfs (rw,nosuid,relatime,size=2908728k,nr_inodes=727182,mode=755,inode64)
      tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=593092k,mode=755,inode64)
      tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
      tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
      tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=593088k,nr_inodes=148272,mode=700,uid=1000,gid=1000,inode64)
      tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=593092k,mode=755,inode64)