5.11. 限制同步速度
您可以控制同步速度,以避免耗尽可用带宽,并防止出现其他性能问题。这可以通过配置 PULP_CONCURRENCY 和 max_speed 参数来完成。请注意,这些设置会在升级时被覆盖。在升级前备份任何更改的文件,以便能恢复配置。
要控制并行运行的同步作业数量,请在
/etc/default/pulp_workers
文件中配置 PULP_CONCURRENCY 参数。例如,要将并行运行的作业数量设置为 1,请将PULP_CONCURRENCY
更改为 1:PULP_CONCURRENCY=1
默认情况下,在少于 8 个 CPU 的系统中,
PULP_CONCURRENCY
设置为 CPU 数量。在超过 8 个 CPU 的系统中,它被设置为 8。要设置同步的最大网络速度(以字节/秒为单位),请配置 max_speed 参数。必须为
/etc/pulp/server/plugins.conf.d/
目录中的每个导入程序单独配置此参数。例如,要将同步 RPM 内容的最大速度设置为每秒 10 字节,请将/etc/pulp/server/plugins.conf.d/yum_importer.json
文件中的"max_speed"
参数设置为 10:# cat /etc/pulp/server/plugins.conf.d/yum_importer.json { "proxy_host": null, "proxy_port": null, "proxy_username": null, "proxy_password": null, "max_speed": 10 }
编辑后验证文件的语法:
# json_verify < /etc/pulp/server/plugins.conf.d/yum_importer.json JSON is valid
重启
satellite-maintain
服务以应用更改:# satellite-maintain service restart