在 CentOS 上运行 Jellyfin 时,性能优化主要集中在 硬件解码、系统资源、存储与网络、配置参数 几个方面。下面按优先级给你一套实用优化方案。
Jellyfin 最吃 CPU 的就是转码。
# 安装 NVIDIA 驱动
yum install -y epel-release
yun install -y kmod-nvidia
# 安装 ffmpeg 支持
yum install -y ffmpeg
Jellyfin 控制台:
Nvidia NVENCNVDEC验证:
nvidia-smi
播放视频时能看到 GPU 占用。
yum install -y intel-media-driver
Jellyfin 选择:
VA-API/dev/dri/renderD128确保用户权限:
usermod -aG video jellyfin
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xvf ffmpeg-release-amd64-static.tar.xz
cp ffmpeg-*-static/ffmpeg /usr/bin/
cp ffmpeg-*-static/ffprobe /usr/bin/
Jellyfin → Transcoding → FFmpeg path:
/usr/bin/ffmpeg
systemctl disable --now firewalld
systemctl disable --now postfix
(如不需防火墙,生产环境谨慎)
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
xfs 文件系统(CentOS 默认支持好)mkdir -p /var/cache/jellyfin
chown jellyfin:jellyfin /var/cache/jellyfin
Dashboard → Transcoding:
/var/cache/jellyfin
✅ 建议放 SSD
Transcoding:
location / {
proxy_pass http://127.0.0.1:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
启用:
客户端:
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
rm -rf /var/lib/jellyfin/metadata/library/*
| 项目 | 推荐 |
|---|---|
| CPU | 4 核以上 |
| 内存 | 8GB+ |
| 转码 | GPU(NVENC / VA-API) |
| 磁盘 | SSD 缓存 + HDD 媒体 |
| 系统 | CentOS 7/8 Stream |
top
htop
nvidia-smi
journalctl -u jellyfin -f
如果你愿意,可以告诉我:
我可以给你 针对性调优方案。