Vote #65321
完了Redmine Takes Too Long On Large Mercurial Repository
100%
説明
Hi ,
I have been using redmine together with mercurial. I used hg convert to convert a subversion repository into a mercurial one and then I configured redmine to read it.
Everytime I click on the repository tab, it hangs for a very long time and then responds afterwards. I thought that this was just initial but it happens everytime I click the Repository tab.
journals
cpu utilization of ruby and hg process is 100% most of the time
--------------------------------------------------------------------------------
is this related to issue #3421
--------------------------------------------------------------------------------
I see the same issue with a hg repository.
--------------------------------------------------------------------------------
Hi,
same happens here - Did you manage to find a workaround?
As a side note - I've imported the mercurial repository from svn as well.
--------------------------------------------------------------------------------
Please see #4455 - Mercurial overhaul.
--------------------------------------------------------------------------------
This patch is only for this issue.
I will describe this patch purpose at #4455 - Mercurial overhaul later.
--------------------------------------------------------------------------------
The reason of this issue is *Mercurial "tip":http://mercurial.selenic.com/wiki/Tip is not latest revision* as I described at http://www.redmine.org/issues/4455#note-23 .
This issue is resolved by "hg-changeset-order.patch":http://www.redmine.org/attachments/4218/hg-changeset-order.patch at http://www.redmine.org/issues/4455#note-144 .
I created test repository for this issue and pushed to http://bitbucket.org/marutosi/redmine-hg-performance-test-repo .
h3. How to create test repository
<pre>
$ hg --version
Mercurial Distributed SCM (version 1.6.3)
$ hg clone -U -r 1.0.0 \
http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean \
redmine-hg-performance-test-repo
requesting all changes
adding changesets
adding manifests
adding file changes
added 3170 changesets with 17488 changes to 3055 files
$ hg --cwd redmine-hg-performance-test-repo/ pull -r 0.9.6 \
http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean
pulling from http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean
searching for changes
adding changesets
adding manifests
adding file changes
added 119 changesets with 185 changes to 199 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg --cwd redmine-hg-performance-test-repo/ tip
changeset: 3288:2f0bae5c51dc
branch: 0.9-stable
tag: tip
user: edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date: Thu Jul 08 03:54:53 2010 +0000
summary: Merged r3836 from trunk.
$ hg --cwd redmine-hg-performance-test-repo/ heads --topo
changeset: 3288:2f0bae5c51dc
branch: 0.9-stable
tag: tip
user: edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date: Thu Jul 08 03:54:53 2010 +0000
summary: Merged r3836 from trunk.
changeset: 3169:251c954b3994
branch: 1.0-stable
user: edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date: Sun Jul 18 16:39:00 2010 +0000
summary: Change version to the show this is the stable branch.
$ hg --cwd redmine-hg-performance-test-repo/ branches
0.9-stable 3288:2f0bae5c51dc
1.0-stable 3169:251c954b3994
default 3161:b993c63dcedb (inactive)
</pre>
Latest revision is "3169:251c954b3994" (SVN r3857 : Sun Jul 18 16:39:00 2010 +0000).
Mercurial tip is "3288:2f0bae5c51dc" (SVN r3838 : Thu Jul 08 03:54:53 2010 +0000).
Current redmine mercurial adapter fetches 119(=3288-3169) changesets *every time*.
h3. Before patch applied
<pre>
Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:04:48) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11151ms (View: 137, DB: 409) | 200 OK [http://localhost/projects/hg-performance-test/repository]
Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:05:21) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11088ms (View: 139, DB: 417) | 200 OK [http://localhost/projects/hg-performance-test/repository]
Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:05:52) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11181ms (View: 136, DB: 408) | 200 OK [http://localhost/projects/hg-performance-test/repository]
</pre>
h3. After patch applied
<pre>
Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:09) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1487ms (View: 154, DB: 245) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]
Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:13) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1750ms (View: 153, DB: 246) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]
Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:16) [GET]
Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1508ms (View: 151, DB: 244) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]
</pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Fixed in svn trunk by r4611 and 1.1 by r4612.
--------------------------------------------------------------------------------
related_issues
relates,Closed,3567,Sorting for changesets might go wrong on Mercurial repos
relates,Closed,1435,slow display of 'repository' tab for huge repository (pagination problem?)
relates,Closed,8857,Git: Too long in fetching repositories after upgrade from 1.1 or new branch at first time