jgm / gitit

A wiki using HAppS, pandoc, and git
GNU General Public License v2.0
2.13k stars 225 forks source link

high CPU usage because of git grep process #680

Open FarmerCzech opened 2 years ago

FarmerCzech commented 2 years ago

Hello,

I would like to ask you about a problem I have with my server. I am running gitit through apache and use it for data storing and sharing with other people. It worked well for a long time, but some time ago, it started to load the server too much. A few times per day, the uptime command shows more than 15, which is a lot. I was trying to identify the problem and it seems, the following command is doing this:

git grep -I -n --null --ignor-case --all-match --word-regexp -e <some path>

These git greps are running several times and are costly on CPU. Do not you have any idea, why this could be happening? I can provide any other information you ask me for.

Just to note, our gitit repository is quite large currently, it has about 20 GB (photos, pdfs, scripts, etc). But some very small files should be excluded. I know, gitit was probably not designed for such large repositories, but I'm not sure if this can be the problem or not...

Thank you for your answer, Petr

jgm commented 2 years ago

This is used for search. You could try disabling search if you don't need it (e.g. by removing the search component from a template). I don't have a better solution.