Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my hgweb server so slow?

I am serving up access to many mercurial repositories using hgweb, providing them as a collection:

[collections]
/home/me = /home/me/projects

This serves them up at localhost/projects

I have around 30 repositories at that location, in a source tree with a fair number of other, non-mercurial-managed projects.

hgweb is really slow to respond; it takes about 30 seconds to provide a listing at http://localhost/, and about 30 seconds to open a project, making it painful to use this for sharing purposes.

How can I tune this to make it faster?

I'm running on OSX, if it makes a difference.

like image 951
Chris R Avatar asked Aug 10 '10 23:08

Chris R


2 Answers

As an open-source alternative, you can use RhodeCode http://rhodecode.com it's hgweb replacement written entirely in Python.

  • has it's own middleware to handle mercurial protocol request each request can be logged and authenticated + threaded performance unlikely to hgweb
  • full permissions per project read/write/admin access even on mercurial request
  • mako templates lets you customize look and feel of application.
  • diffs annotations and source code all colored by pygments.
  • mercurial branch graph and yui-flot powered graphs
  • admin interface for performing user/permission management as well as repository management.
  • Additional settings for mercurial web, (hooks editable from admin panel !) also manage paths, archive, remote messages
  • backup scripts can do backup of whole app and send it over scp to desired location
  • setup project descriptions and info inside built in db for easy, non file-system operations
  • Full search text on repository codes
  • added cache with invalidation on push/repo managment for high performance and always upto date data.
  • rss / atom feeds, gravatar support
  • based on pylons 1.0 / sqlalchemy
like image 191
marcinkuzminski Avatar answered Nov 15 '22 12:11

marcinkuzminski


AFAIK, hgweb will scan all subdirectories of the [collections] entry in its configuration file. Since you've got a lot of non-Mercurial directories in there, it has to do a scan of each subdirectory of each of them. In contrast, it can stop scanning at the top level of a directory tree containing a Mercurial repository because it will see the .hg directory there.

If you're using a newer Mercurial (after 1.1, it looks like), try changing the hgweb.config to use a [paths] section instead, and provide explicit entries for each of the Mercurial repositories.

like image 32
Niall C. Avatar answered Nov 15 '22 10:11

Niall C.