Gerrit .pack size abnormal

122 views
Skip to first unread message

姜磊

unread,
Aug 21, 2023, 3:55:50 AM8/21/23
to Repo and Gerrit Discussion
There has a git repository space issue on our gerrit system, and its size is abnormal.

We used git clone checkout to find out the size is only 550M, but its space size on the gerrit server has exceeded 30G and is still growing.
Git clone size.JPG

After checking, I found that there is a large number of pack directories on the server side, whether this is due to the user using the online editing feature.
Can these.pack files be cleaned, and do they cause any exceptions?

The version of gerrit we are currently using is 3.6.1

Server-pack size.JPG
Server-side.JPG

Sven Selberg

unread,
Aug 21, 2023, 8:04:58 AM8/21/23
to Repo and Gerrit Discussion
On Monday, August 21, 2023 at 9:55:50 AM UTC+2 姜磊 wrote:
There has a git repository space issue on our gerrit system, and its size is abnormal.

We used git clone checkout to find out the size is only 550M, but its space size on the gerrit server has exceeded 30G and is still growing.
Git clone size.JPG

After checking, I found that there is a large number of pack directories on the server side, whether this is due to the user using the online editing feature.
Can these.pack files be cleaned, and do they cause any exceptions?

Do run git gc or repack on a regular basis (daily, hourly)?

sunyl...@gmail.com

unread,
Aug 21, 2023, 10:38:43 PM8/21/23
to Repo and Gerrit Discussion
Hi Sven
    Thanks for your support.
     No, we didn't run git gc or repack on a regular basis, but we use a script to back up all the repositories on this gerrit server every day.
     We have nearly 3,000 repositories on this gerrit server, but only this git repository has this problem, and only this git repository will be online editing by users, they will edit and update comments on the webpage.  Thanks

Sven Selberg

unread,
Aug 22, 2023, 2:45:25 AM8/22/23
to Repo and Gerrit Discussion
On Tuesday, August 22, 2023 at 4:38:43 AM UTC+2 sunyl...@gmail.com wrote:
Hi Sven
    Thanks for your support.
     No, we didn't run git gc or repack on a regular basis, but we use a script to back up all the repositories on this gerrit server every day.

It is highly recommended that you run some sort of gc/repack job regularly. This increases performance and decreases disk-usage.
You can read more here:
https://gerrit-documentation.storage.googleapis.com/Documentation/3.6.1/repository-maintenance.html

As the user that runs gerrit you can issue a repack manually in this project and check the results.
 trouble-git$ git repack -A -d -b
 trouble-git$ git pack-refs --all

Or just:
  trouble-git$ git gc

sunyl...@gmail.com

unread,
Aug 24, 2023, 5:28:50 AM8/24/23
to Repo and Gerrit Discussion
Sven
   Thanks,  I will take a try on another offline server. Thanks for your help

Reply all
Reply to author
Forward
0 new messages