Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shallow clone for better performance #1544

Open
marnee01 opened this issue Jan 24, 2020 · 4 comments · May be fixed by #2403
Open

Shallow clone for better performance #1544

marnee01 opened this issue Jan 24, 2020 · 4 comments · May be fixed by #2403

Comments

@marnee01
Copy link
Contributor

We regularly see response times from our config server of 15-25 seconds. We have on average ~30 requests with response times > 15s each day. These high response times happen when config server is fetching from one of our repos and there are updates in that repo. There are often updates since any time someone creates a new feature branch and makes a change to it, that is an update.

This repo has many, many files in it (for multiple applications). Some of the files have 1000s of lines. But the biggest culprit, I believe, is that it has a huge amount of history.

We are looking at potentially breaking it into multiple repos (and use the new composite repos feature for shared configs). That will help. However, the team wants to migrate the history over to the new repos, so now we will have multiple repos with huge history instead of just one.

We were hoping that we could improve performance by configuring the config server to do a shallow clone of the repos (e.g. git clone --depth 1) . There doesn't appear to be an option for that right now.

The Request: I'd like to request you to enhance the config server to allow for optionally doing a shallow clone.

I realize this might not be feasible. I'm nearly a novice with git, and not sure if such a shallow clone would "play nicely" with the existing config server repo wrt to updates, etc. Also, it appears that the jgit library itself does not expose an option for doing a shallow sync (though I could have missed something).

If not feasible, or not something that might be implemented in the next couple of releases, is there an existing alternative option that might help improve our config server's response time? (Even if this feature does get into the queue, is there something I can do right now to improve performance?)

Note: We're currently at Greenwich.SR3.

@dungtm007
Copy link

Is there any update on this enhancement?

@Michael-S-Smith
Copy link

Any update on this? We would also be helped by having a shallow clone option. Is there really any reason to ever want branch history in the cloned branch used by cloud config?

@vladonemo
Copy link
Contributor

vladonemo commented Jul 26, 2022

Would like to have this feature, too. Sadly, jgit doesn't support shallow clone yet. See the bug and gerrit.

It does support the partial clone though. You can achieve this by adding your own TransportConfigCallback to the repository, e.g.:

        TransportConfigCallback callback = t -> {
            t.setFilterSpec(FilterSpec.fromFilterLine("tree:0"));
            t.setFilterSpec(FilterSpec.fromFilterLine("blob:none"));
        }

However, not all git servers comply with the partial clone spec, e.g. Azure DevOps doesn't

@michael-schnell
Copy link

I guess JGit supports in the meantime what is requested here:

Shallow Clone and Fetch
The following methods were added to CloneCommand and FetchCommand to tell the server that the client doesn't want to download the complete history

https://wiki.eclipse.org/JGit/New_and_Noteworthy/6.3

pukkaone added a commit to pukkaone/spring-cloud-config that referenced this issue Apr 9, 2024
Do not download the entire commit history from the remote.  Execute the
equivalent of `git clone --depth 1`

Fixes spring-cloud#1544
pukkaone added a commit to pukkaone/spring-cloud-config that referenced this issue Apr 9, 2024
Do not download the entire commit history from the remote.  Execute the
equivalent of `git clone --depth 1`

Fixes spring-cloud#1544
pukkaone added a commit to pukkaone/spring-cloud-config that referenced this issue Apr 9, 2024
Do not download the entire commit history from the remote.  Execute the
equivalent of `git clone --depth 1`

Fixes spring-cloud#1544
@pukkaone pukkaone linked a pull request Apr 9, 2024 that will close this issue
pukkaone added a commit to pukkaone/spring-cloud-config that referenced this issue Apr 9, 2024
Do not download the entire commit history from the remote.  Execute the
equivalent of `git clone --depth 1`

Fixes spring-cloud#1544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants