user@argobox:~/journal/2025-12-24-the-plex-stutter-that-ruined-movie-night
$ cat entry.md

The Plex Stutter That Ruined Movie Night

○ NOT REVIEWED

The Plex Stutter That Ruined Movie Night

Date: December 24, 2025 Issue: Constant micro-stuttering during Plex playback Root Cause: CIFS cache expiring every 1 second Status: Fixed with three mount option changes


The Symptom

Christmas Eve. Family movie night. Hit play on Plex.

Buffer. Play. Buffer. Play. Buffer.

Every second or two, a tiny hitch. Not long enough to fully pause, but enough to ruin the experience. The kind of stutter that makes you think “is the network bad?” but the network was fine.


The Setup

Plex runs in an LXC container on Titawin-Host (Proxmox). Media lives on the NAS at 192.168.20.8. The container mounts the NAS shares via CIFS.

The container had 6 cores, 8GB RAM, GPU passthrough for hardware transcoding. More than enough horsepower. Network between container and NAS was gigabit, sub-millisecond latency.

So why the stuttering?


The Investigation

Checked the mount options:

mount | grep Content
//192.168.20.8/Content on /mnt/Content type cifs (
  rw,relatime,
  vers=3.0,
  cache=strict,
  ...
  actimeo=1,
  ...
)

There it was. actimeo=1.

The attribute cache timeout was set to one second.

Every single second, the kernel threw away its cached knowledge of file sizes, timestamps, and directory contents. Every second, it asked the NAS: “Hey, did anything change?” The NAS replied. The cache refreshed. And during that round-trip? Micro-stutter.


The Math

Individual cache revalidation: ~0.5ms Frequency: Once per second Over an hour: 0.5ms × 3600 = 1.8 seconds of accumulated latency

That doesn’t sound like much. But when each revalidation happens mid-frame, the video player hiccups. The stream buffers. Christmas Eve becomes “pause the movie again.”


The Fix

Changed three settings in /etc/fstab:

Before:

cache=strict
actimeo=1
soft

After:

cache=loose
actimeo=30
hard

Unmounted, remounted:

umount /mnt/Content /mnt/myContent
mount -a

Verified the new settings:

mount | grep actimeo
# actimeo=30

What Each Change Does

cache=strict → cache=loose

strict validates with the server on every read. Safe for files that might change. Terrible for media files that haven’t changed in months.

loose caches aggressively. Perfect for read-only media directories.

actimeo=1 → actimeo=30

Instead of refreshing the cache every 1 second, now it refreshes every 30 seconds. That’s 30x fewer round-trips to the NAS.

soft → hard

soft mounts can timeout and fail. If the NAS is slow to respond, the mount gives up and returns an error.

hard mounts wait indefinitely. The mount keeps trying until it succeeds. For media streaming, reliability beats speed.


The Result

Hit play on Plex.

No buffer. No stutter. Smooth.

Full 30-second windows of uninterrupted playback. The cache revalidation now happens in the background, between scenes, when nobody notices.


Why the Defaults Were Wrong

Linux CIFS defaults prioritize safety over performance:

  • cache=strict assumes files change constantly (they don’t, for media)
  • actimeo=1 assumes metadata changes every second (it doesn’t)
  • soft prefers quick failure over waiting (wrong for streaming)

These defaults make sense for a corporate file server where documents change hourly. For a media library that hasn’t changed in weeks? They’re actively harmful.


The Rollback Script

Because I’m paranoid, I wrote an undo script before applying the changes:

#!/bin/bash
# Restore original fstab
cp /etc/fstab.backup-20251224-cifs-fix /etc/fstab

# Unmount and remount
umount /mnt/Content /mnt/myContent
mount -a

# Restart Plex
cd /opt/docker-compose && docker compose restart

Saved it next to the backup. Just in case the new settings caused problems.

They didn’t.


Performance Comparison

Before:

  • Cache revalidation: 60 times per minute
  • Accumulated latency: ~30ms per minute
  • User experience: Constant micro-stuttering

After:

  • Cache revalidation: 2 times per minute
  • Accumulated latency: ~1ms per minute
  • User experience: Smooth playback

The Lesson

Small delays accumulate. Half a millisecond sounds negligible. But when it happens 3,600 times per hour, it adds up.

Check your mount options. CIFS defaults are conservative. For read-only media workloads, you can safely make them aggressive.

Profile before optimizing. I could have spent hours tweaking Plex settings, transcoder options, network buffers. The problem was never Plex. It was the mount options.


Christmas Eve movie night: saved. By three lines in fstab.