gitweb 变得很慢
我已将 $projectroot 指向包含 n 个 git 项目的 400GB 目录。早些时候我们只有很少的项目,并且 gitweb 启动得非常快,一旦项目数量开始增长,加载就需要时间。有什么办法可以加快速度吗?
I have pointed $projectroot to directory which is of 400GB contains n number of git projects. earlier we had only few project and gitweb started very fast, once project number started growing it is taking time to load. IS there any way to speed up ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Gitweb 递归搜索
$projectroot
下的所有目录来查找项目。如果有很多文件,显示顶层将花费很多时间。尝试添加/etc/gitweb.conf 中的项目布局,以将搜索限制为
$projectroot
的第一个目录级别。就像 andygavin 的答案一样,如果您有非裸存储库也包含那里的签出,那么很容易在
$projectroot
下获得巨大的目录树。最好在其他地方进行签出,并且只在 gitweb 下使用裸存储库。使用从非裸项目中为 gitweb 进行裸克隆,然后将
$projectroot
配置为/ path/to/gitweb/
而不是/path/to/projects/
。Gitweb recursively searches all directories under
$projectroot
to find projects. If there are lots of files displaying the top level will take lots of time. Try addingin your /etc/gitweb.conf to limit the searches to first directory levels of
$projectroot
.Like andygavin's answer suggests it's easy to get huge directory trees under
$projectroot
if you have non-bare repositories that contain also the checkouts there. It's better to have the checkouts somewhere else and only bare repositories under gitweb. Useto make bare clone for gitweb from your non-bare project and then configure
$projectroot
to/path/to/gitweb/
instead of/path/to/projects/
.很难说为什么它很慢,但是存储库有很多松散的对象尝试:
gitweb 存储库是裸,这是一个很好的做法,我不清楚你提到的是否有文件的大小与索引一起。
Difficult to tell why it is slow however the repository has a lot of loose objects try:
It is good practice that the gitweb repository is bare, I'm not clear size that you mention whether you have the files alongside the index.