Slow hgweb.cgi

Dominik Psenner dpsenner at gmail.com
Tue Apr 12 07:17:30 CDT 2011


Hi guys,

we're experiencing really slow push/pull performance while using a
apache/hgweb.cgi repository publishing with wscgi. It takes almost a full
minute to pull 2 of changesets with a diff size of only 4kb! If I do a
simple hg incoming it also takes a long time.

The repository server is a headless ubuntu vm and the repository data is
physically stored on another server and accessed with cifs/samba. The
mercurial version we run is 1.6.3 from the ubuntu 10.10 default
repositories. I also observed that the python script invoked by apache peaks
to use one core of the server completely. So unfortunately the long wait
times are on the server side.

Could the cifs/samba storage cause the problems?

Or have you any ideas what could speed it up? I could even go and
troubleshoot for problems if one tells me how.

Feel free to ask me for installation details. For now I include just the hg
version, script, apache site config and the hgweb.cgi config file.

Greetings,
D.

--- from here on there are only attachments ---

Some repository info:

$ du -sh .
223M    .
$ hg sum
parent: -1:000000000000  (no revision checked out)
branch: default
commit: (clean)
update: 1891 new changesets (update)

Essential apache site config parts:

        ScriptAliasMatch        ^/hg(.*)        /var/hg/hgweb.cgi$1
        <Directory /var/hg>
                Options ExecCGI FollowSymLinks
                AllowOverride None

                Order allow,deny
                Allow from all
        </Directory>

The script we use:

$ cat hgweb.cgi
#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/var/hg/hgweb.config"

# let the output be UTF-8
import os;
os.environ["HGENCODING"] = "UTF-8"

# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)
# eof

The config file:

$ cat hgweb.config
[collections]
repos/ = repos/
[web]
style = gitweb
push_ssl = false
allow_push = *
allow_archive = gz zip bz2
# eof



More information about the Mercurial-devel mailing list