yum – 我该怎么做才能加速createrepo?

前端之家收集整理的这篇文章主要介绍了yum – 我该怎么做才能加速createrepo?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们使用yum存储库将我们的软件分发到我们的生产实例.不幸的是,createrepo正在成为一个瓶颈,我们在存储库中只有469个包.
$time createrepo /opt/tm-yum-repo
Spawning worker 0 with 469 pkgs
Workers Finished
Gathering worker results

Saving Primary Metadata
Saving file lists Metadata
Saving other Metadata
Generating sqlite DBs
sqlite DBs complete

real    0m43.188s
user    0m37.798s
sys 0m1.296s

我该怎么做才能让它更快?

dmourati在他的回答中给出的–cachedir选项对你有帮助,但是你也应该使用–update,特别是如果你不是一次替换所有469个包.
--update
              If Metadata already exists  in  the  outputdir  and  an  rpm  is
              unchanged  (based on file size and mtime) since the Metadata was
              generated,reuse the existing Metadata rather than recalculating
              it.  In  the  case  of a large repository with only a few new or
              modified rpms this can significantly reduce I/O  and  processing
              time.

此外,如果以这种方式部署它是真正时间敏感的,那么考虑为这个包创建一个单独的repo,而更新也没有用.

猜你在找的Bash相关文章