diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2018-08-15 15:11:57 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2018-08-15 15:11:57 -0400 |
commit | 636e3735aa36cde4ac18e9d88e738b627a3c8663 (patch) | |
tree | 6d5d0dde21e7d7b2aa35b5187493acc90db5dc7e | |
parent | 299b0d063ab011b056a853541c537885ba274bb8 (diff) | |
download | grokmirror-636e3735aa36cde4ac18e9d88e738b627a3c8663.tar.gz |
Tweak loose object count calculations
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | grokmirror/fsck.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/grokmirror/fsck.py b/grokmirror/fsck.py index 3aef2a1..57c305a 100755 --- a/grokmirror/fsck.py +++ b/grokmirror/fsck.py @@ -401,6 +401,8 @@ def fsck_mirror(name, config, verbose=False, force=False, repack_only=False, # optimal values will depend on the size of the repo as a whole max_loose_objects = 1200 max_packs = 20 + pc_loose_objects = 10 + pc_loose_size = 10 # first, compare against max values: if packs >= max_packs: @@ -419,11 +421,13 @@ def fsck_mirror(name, config, verbose=False, force=False, repack_only=False, total_size = size_loose + size_pack # set some arbitrary "worth bothering" limits so we don't # continuously repack tiny repos. - if total_obj > 100 and count_loose/total_obj*100 >= 5: - logger.debug('Triggering repack of %s because loose objects > 10%% of total', fullpath) + if total_obj > 500 and count_loose/total_obj*100 >= pc_loose_objects: + logger.debug('Triggering repack of %s because loose objects > %s%% of total', + fullpath, pc_loose_objects) needs_repack = 1 - elif total_size > 1024 and size_loose/total_size*100 >= 5: - logger.debug('Triggering repack of %s because loose size > 10%% of total', fullpath) + elif total_size > 1024 and size_loose/total_size*100 >= pc_loose_size: + logger.debug('Triggering repack of %s because loose size > %s%% of total', + fullpath, pc_loose_size) needs_repack = 1 # Do we need to fsck it? |