开发者

gitweb became slow

开发者 https://www.devze.com 2023-03-27 09:49 出处:网络
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 ta

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 spe开发者_如何学Goed up ?


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 adding

$project_maxdepth = 1; # or slightly larger integer depending your project layout

in 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. Use

git clone --bare /path/to/projects/project /path/to/gitweb/project

to make bare clone for gitweb from your non-bare project and then configure $projectroot to /path/to/gitweb/ instead of /path/to/projects/.


Difficult to tell why it is slow however the repository has a lot of loose objects try:

git gc --aggressive 

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消