• Icon: Suggestion Suggestion
    • Resolution: Answered
    • None
    • None
    • None
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Related to https://answers.atlassian.com/questions/12270327 .
      It would be great to have an option to schedule regular, pre-emptive Git GC's. (e.g. run GC every day at 2:00AM or every week on Sunday at 5:00AM)

      Git GC is quite resource-intensive on big repos and the response time towards users degrades while it is running.
      I would like Stash to run pre-emptive GC's at times of low load, to avoid them being triggered automatically by Git after a push in the middle of the workday.

          Form Name

            [BSERV-7102] Create option for scheduling regular Git GC's

            Thanks it34. We did some work previously in 5.2, it sounds like you've already got that.

            Roger Barnes (Inactive) added a comment - Thanks it34 . We did some work previously in 5.2, it sounds like you've already got that.

            We are on 5.5.0 right now, upgrading shortly (had to move some stuff around re disk space which is why we aren't on latest.

            Mutual Mobile IT added a comment - We are on 5.5.0 right now, upgrading shortly (had to move some stuff around re disk space which is why we aren't on latest.

            it34, could you confirm what version of Bitbucket Server you're running?

            Roger Barnes (Inactive) added a comment - it34 , could you confirm what version of Bitbucket Server you're running?

            it34, if you're asking whether it's ok to run git gc, it's not recommended. git gc does some good things (as we know), but it also does some things that Bitbucket's hosting needs prefer not to happen (and I must admit I don't have the exact details to hand, so I could be understating this). Instead, Bitbucket takes care of GC operations itself, calling lower level git functions to ensure the good changes happen, but not the less good ones.

            All that said, it's fair to say this arrangement could be made better, and we are looking at making some improvements.

            Roger Barnes (Inactive) added a comment - it34 , if you're asking whether it's ok to run git gc, it's not recommended. git gc does some good things (as we know), but it also does some things that Bitbucket's hosting needs prefer not to happen (and I must admit I don't have the exact details to hand, so I could be understating this). Instead, Bitbucket takes care of GC operations itself, calling lower level git functions to ensure the good changes happen, but not the less good ones. All that said, it's fair to say this arrangement could be made better, and we are looking at making some improvements.

            Mutual Mobile IT added a comment - - edited

            @roger.barnes Do you think it would be run `git gc` on every on repo? 

            find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git gc" \;

            in the /shared/data/repositories directory? I ran it on a few repos and saved a decent amount of space already. 

            Mutual Mobile IT added a comment - - edited @roger.barnes Do you think it would be run `git gc` on every on repo?  find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git gc" \; in the /shared/data/repositories directory? I ran it on a few repos and saved a decent amount of space already. 

            Our use case is that rarely updated but highly fragmented git repos will not be garbage collected. This increases the footprint (size) of the repository, and greatly increases the time and space necessary for backups, especially with relatively high latency NAS filestores.

            Deleted Account (Inactive) added a comment - Our use case is that rarely updated but highly fragmented git repos will not be garbage collected. This increases the footprint (size) of the repository, and greatly increases the time and space necessary for backups, especially with relatively high latency NAS filestores.

            Thanks Balazs for clarifying.

            As I suggested previously, I don't think this is something we'll add in the near future. We will however, continue to be mindful of git performance and consider solutions should a recurring problem emerge.

            Roger Barnes (Inactive) added a comment - Thanks Balazs for clarifying. As I suggested previously, I don't think this is something we'll add in the near future. We will however, continue to be mindful of git performance and consider solutions should a recurring problem emerge.

            I don't really know how often we experience this or how long delay it causes, since it is always someone else experiencing it. (I do know that when my own local clone does an auto-gc, it takes about 3 mins, so my educated guess is that the server would do it in about 20-40 sec.) I think an optional plugin would probably be the right way of solving this problem, since only big repos (= long GC) with many users (=frequent changes) are impacted in a noticeable way.

            Balázs Szakmáry added a comment - I don't really know how often we experience this or how long delay it causes, since it is always someone else experiencing it. (I do know that when my own local clone does an auto-gc, it takes about 3 mins, so my educated guess is that the server would do it in about 20-40 sec.) I think an optional plugin would probably be the right way of solving this problem, since only big repos (= long GC) with many users (=frequent changes) are impacted in a noticeable way.

            Hi basz, could you elaborate on how often you experience this and how much longer the operation takes? It's unlikely that we'd build scheduled GC in, but perhaps there are some alternatives we can explore once we better understand your situation.

            Roger Barnes (Inactive) added a comment - Hi basz , could you elaborate on how often you experience this and how much longer the operation takes? It's unlikely that we'd build scheduled GC in, but perhaps there are some alternatives we can explore once we better understand your situation.

            Yes, auto gc will be disabled for a repository as soon as it has forks and all the repositories that are forks.

            Stefan Saasen (Inactive) added a comment - Yes, auto gc will be disabled for a repository as soon as it has forks and all the repositories that are forks.

              Unassigned Unassigned
              a8fb56ff7916 Balázs Szakmáry
              Votes:
              2 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: