Quick tip: Better network performance when serving video

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Quick tip: Better network performance when serving video

Post by Moonstone Man »

I run LMDE4 on an AMD 3900XT CPU as my central server. One of the problems I've had, especially with small videos under 200-300MB in size is screen corruption and glitching on the client side, though no such problems existed with high quality video from larger files up to around 12GB in size. While researching something completely unrelated, I came across this:

sudo blockdev --getra /dev/sda

Intrigued, I did a little more lurking around and it led me to this:

sudo blockdev --setra 409600 /dev/sda

The command changes the kernel's default drive read-ahead buffer from a paltry 128kB to a more suitable 200MB (value x 512 bytes = ra size in bytes). You can vary the number according to your file size and available RAM, up to gigabytes if you wish. I'll play around with larger numbers eventually but for now, I'm pleased to say that the glitching seen on client machines with small video files has completely stopped.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Chat about Linux”