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

Problem with large repository #279

Closed
ptman opened this issue Jul 8, 2014 · 27 comments
Closed

Problem with large repository #279

ptman opened this issue Jul 8, 2014 · 27 comments
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it
Milestone

Comments

@ptman
Copy link
Contributor

ptman commented Jul 8, 2014

We have a large repository (~2GB .git) with a bit under ~40k commits and over 30k files in the master branch. It cannot be pushed to an empty repository in gogs without errors. Unfortunately I cannot publish the repository as it is a commercial software product.

@unknwon unknwon added the Bug label Jul 8, 2014
@unknwon
Copy link
Member

unknwon commented Jul 8, 2014

This one is really huge... somewhat like the linux source code

@ptman
Copy link
Contributor Author

ptman commented Jul 8, 2014

Git itself has no problem with that repository size. And Gitlab seems to have at least one 18GB repository

@unknwon
Copy link
Member

unknwon commented Jul 8, 2014

As far as I know, and could be wrong, GitLab uses git-shell which calls git directly from pipeline, which let git self handles everything. Gogits/git implementation has a lot issues. Anyway, I need to get some repository as large as your to test.

@ptman
Copy link
Contributor Author

ptman commented Jul 15, 2014

I tested git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git and pushing that to gogs also failed.

@unknwon
Copy link
Member

unknwon commented Jul 15, 2014

Linux source was reported failed here before: #121

@nussjustin
Copy link
Contributor

I think I found the problem, but it will probably take some time to fix it.

@unknwon
Copy link
Member

unknwon commented Jul 24, 2014

@nuss-justin you're blowing up the work! LOL

@nussjustin
Copy link
Contributor

That's what I call 'boredom at work/home' :-)

@nussjustin
Copy link
Contributor

Ok, it seems like hashing the sha1 hashes for the offsetValues map is really slow.
To work around that I think there are 2 solutions:

  1. Don't read the whole file. I don't know if this would cause any big problems.
  2. Store all infos about the repo somewhere it can be accessed faster (for example the database).

The 2. one would be really great I think, but it would complicate everything and take more disk space, because now commits, diffs, etc. would involve the database and we would have to rewrite some parts of the current code, that depends on the current structs for commits, etc. Also every commit would have to be inserted in the database.

On the other side, having everything inside the database would make it much faster. With indexes (and good database settings) access would be really fast.

Another way to do 2. would be to write another git module, that wraps the current gogits/git module and caches everything in the database, for faster accesses. (So it would first try to find something in the database and if it doesn't find anything it would fetch it from disk and then cache it in the database)

If you have other ideas, I'm open for everything :-)

@unknwon
Copy link
Member

unknwon commented Jul 24, 2014

Store all infos about the repo somewhere it can be accessed faster (for example the database).

Cache system is on the plan, but do not PR on this please until we release 0.5.

@nussjustin
Copy link
Contributor

Be reassured, I don't plan to start something big like this without discussing it with you ^^
I'm working on gogs mostly when im bored at work and big thinks are always difficult to do, when i constantly have to switch between multiple projects.

@unknwon
Copy link
Member

unknwon commented Jul 25, 2014

Haha, you're good!

@unknwon
Copy link
Member

unknwon commented Aug 1, 2014

With new git-shell implementation, I've tested linux source code, takes 5s~12s to load page, would you mind to try dev code and see if have any problem regardless of load time?

@ptman
Copy link
Contributor Author

ptman commented Aug 11, 2014

Now I managed to push linux.git into gogs. But it took 3.5h! Most of the time gogs serv was calling git cat-file, maybe in modules/git/repo_commit.go

@ptman
Copy link
Contributor Author

ptman commented Aug 11, 2014

I no longer had any trouble with our in-house ~2GB git repo. Thanks!

@ptman ptman closed this as completed Aug 11, 2014
@unknwon
Copy link
Member

unknwon commented Aug 11, 2014

Now I managed to push linux.git into gogs. But it took 3.5h! Most of the time gogs serv was calling git cat-file, maybe in modules/git/repo_commit.go

Is it happen when you push through SSH? Or HTTPS?

@ptman
Copy link
Contributor Author

ptman commented Aug 11, 2014

SSH

@unknwon unknwon reopened this Aug 14, 2014
@unknwon
Copy link
Member

unknwon commented Aug 14, 2014

I think it would better to keep this issue open, to remind me. :)

@TonyTsangHK
Copy link
Contributor

Tested with current dev version (0.5.5.1014 Beta ).

Trying to push linux github.com/torvalds/linux to gogs.
Taking 4 hour still not finished after 6 hours failed.

Reading xorm.log, it is still working with hook_task and the log interval is one minute per log entry. (Not related)

Server is a Digitalocean 1 core / 1G droplet.

@unknwon
Copy link
Member

unknwon commented Oct 16, 2014

@tobyzxj Using HTTP or SSH?

@tobyzxj
Copy link
Contributor

tobyzxj commented Oct 16, 2014

@unknwon SSH!

@b6d
Copy link

b6d commented Jun 12, 2015

I'd like to add another data point:

We maintain a 1.2 GB repository with less than 100 commits (manually tracking a vendor).

A first push to Gogs 0.6.1 via https works, but trying to view the repository in the web interface afterwards results in a HTTP 500:

[Macaron] Completed /vw-it/test 500 Internal Server Error in 3.783941ms
2015/06/12 14:35:42 [repo.go:281 func·008()] [E] GetTags: 

Only after we restart Gogs web, the error goes away. Subsequent (smaller) pushes seem to work without problem. How tags fit in this (GetTags from the log), I don't know, this particular repository doesn't have any.

@unknwon
Copy link
Member

unknwon commented Dec 10, 2015

Everyone on this thread please checkout develop branch, I've tested with mono project with over 100k commits.

@unknwon unknwon added this to the 0.8.0 milestone Dec 10, 2015
@unknwon unknwon added the status: needs feedback Tell me more about it label Dec 10, 2015
@unknwon
Copy link
Member

unknwon commented Dec 10, 2015

Tested with https://github.com/torvalds/linux with SSH as well.

@unknwon
Copy link
Member

unknwon commented Dec 12, 2015

Close as fixed.

@unknwon unknwon closed this as completed Dec 12, 2015
@Longshot123
Copy link

Is it required to use SSH to fix this problem? We are having the same issue pushing 1.4GB repo with 1255 commits over http.

@unknwon
Copy link
Member

unknwon commented Feb 12, 2016

@Longshot123

Is it required to use SSH to fix this problem?

Yes...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it
Projects
None yet
Development

No branches or pull requests

7 participants