Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitweb became slow

Tags:

git

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 ?

like image 906
maestromani Avatar asked Oct 10 '22 06:10

maestromani


1 Answers

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/.

like image 59
Ossi Avatar answered Oct 12 '22 21:10

Ossi