CentOS 下提升 Compton 多任务处理能力
一 核心优化思路
二 推荐配置示例与关键参数
# 渲染与同步
backend = glx
vsync = false # 做 A/B 测试:true 更稳、false 可能更高 FPS
refresh-rate = 60 # 与显示器刷新率一致
# 特效精简
shadow = false
blur-background = false
opacity-rule = [ "90:class_g = 'Firefox'", "90:class_g = 'Terminal'" ]
# 帧率与重绘控制
fps-limit = 60
mark-wmwin-focused = true
mark-ovredir-focused = true
use-ewmh-active-win = true
detect-rounded-corners = true
detect-client-leader = true
# 避免与桌面特效冲突
unredir-if-possible = true
三 CentOS 下的应用与验证
sudo yum install compton 或 sudo dnf install comptoncompton --replace &compton -bcompton --replace & 重载;若以服务方式管理,可用 systemctl --user restart compton(如使用 systemd 用户会话)。cpulimit -l 50 -p $(pgrep compton)top -p $(pgrep compton)、pidstat -u -p $(pgrep compton) 1glxgears 或 vkcube 做简单对比;在应用内查看 FPS(如浏览器/游戏)。四 进阶与排障
unredir-if-possible、mark-wmwin-focused、detect-client-leader 等,减少全屏/遮挡场景的无效合成。opacity-rule 细粒度开启,避免全局透明。