Using RAM for transcoding media files on Jellyfin

The ‘iotop’ command is a powerful Linux tool designed for monitoring disk Input/Output (IO) usage in real-time. It provides a comprehensive view of the current disk IO activities by processes, making it invaluable for system administrators who need to track down processes that are causing high disk IO, potentially impacting system performance. Written in Python, ‘iotop’ requires specific kernel modules and a Python interpreter for execution, typically needing root privileges.

This tool’s functionality is similar to the top command, but it specifically focuses on disk IO operations. With ‘iotop’, you can easily identify processes that are reading from or writing to disk, allowing for efficient troubleshooting of performance issues related to disk IO.

install iotp

sudo apt install iotop -y
sudo iotop -ao

Jellyfin will trigger a library rescan now that the sizes were changed. Check the logs again for messages.

sudo journalctl -u jellyfin | tail -n 40
[INF] Library scan started: Movies
[INF] Library scan finished

~$ sudo iotop -ao -b 
| head Total DISK READ: 569.71 K/s 
| Total DISK WRITE: 66.61 M/s Current DISK READ: 932.25 K/s 
| Current DISK WRITE: 0.00 B/s

What’s happening

  • ffmpeg (the first line) is doing heavy disk writes — about 66 MB/s — because Jellyfin is transcoding a 4K HDR video.
  • This is normal when streaming a high-bitrate 4K file to a device that doesn’t support the native format (it’s tonemapping from HDR → SDR and downscaling).
  • That transcoding process is I/O-intensive (writing temporary files to /transcode) and CPU-heavy.
  • The other entries (qbittorrent-nox) show light I/O activity — nothing alarming there.

So the slowness you’re seeing is very likely due to transcoding load, not a problem with your recent storage expansion.

Expanding the RAM

2 simultaneous 4K transcodes: 2–4 GB RAM for the transcode mount should suffice.

4–6 GB if you want comfortable headroom for Docker, caching, and future scaling.

Don’t go overboard—your R730xd likely has dozens of GB of RAM, but dedicating hundreds of GB for a RAM disk for just 2 streams isn’t necessary.

sudo mkdir -p /mnt/ramtranscode
sudo mount -t tmpfs -o size=4G tmpfs /mnt/ramtranscode

Point Plex Docker transcode directory to /mnt/ramtranscode in the docker compose

volumes:
  - /mnt/ramtranscode:/transcode

Restart Jellyfin container

docker-compose down
docker-compose up -d

Make it persistent across reboots

Anything in tmpfs disappears on reboot. Adding this line to /etc/fstab will make it restart on reboot

tmpfs /mnt/ramtranscode tmpfs defaults,size=6G 0 0

Monitor the RAM to see if it is falling back on swap

free -h
htop

Check the mount

mount | grep ramtranscode
tmpfs on /mnt/ramtranscode type tmpfs (rw,size=6G)
   

watch in iotop

iotop -ao

you should see no writes to the disk now that it is using the RAM

Leave a Reply 0

Your email address will not be published. Required fields are marked *