我该怎么做才能加速createrepo?

Modified on: Fri, 20 Sep 2019 13:40:02 +0800

我们正在使用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

我可以做些什么来加快速度?

作者:jsd

最佳答案

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,这对时间非常敏感,而--update则无济于事。

作者:Michael Hampton

相关问答

添加新评论