Converting Mercurial hgweb from CGI to WSGI
Angel Ezquerra
angel.ezquerra at gmail.com
Thu Aug 2 07:54:17 UTC 2012
On Wed, Aug 1, 2012 at 6:13 PM, Timm Aaron M <TimmAaronM at phoeintl.com> wrote:
> I am new to trying to set things like this up so please bear with me. I am
> currently running Hgweb using CGI on IIS 7. To improve the speed I want to
> change the set up to use WSGI. I am currently running Mercurial 2.1 and
> Python 2.7. I have installed Pywin32 217 and isapi-wsgi 0.4.2 recently. I
> have followed the steps here:
> http://www.eworldui.net/blog/post/2010/04/08/Setting-up-Mercurial-server-in-IIS7-using-a-ISAPI-module.aspx
> through creating the shim dll but I have stopped after that. I need a
> simple/easy to understand explanation of a way to finish converting my set
> up to run with WSGI. Any help would be greatly appreciated. Thanks.
>
Hi Timm,
I have some recent experience tackling performance problems with the
mercurial web server on windows. I can't help you on your specific
issue, since we are using Apache, rather than IIS. However I have one
recommendation:
If you serve many repositories, particularly if you use subrepos, _do
not_ use globs (particularly recursive globs) to specify them in your
"paths" section. Instead list each repository on your paths section
one by one.
Mercurial currently looks for repos on every location that you specify
with a glob on your paths section _for every request_. I think this is
particularly expensive in CGI mode. In WSGI there is some catching (I
believe), which reduces the impact of problem.
We are serving several hundred repos and subrepos, and we created a
script that scans the locations were we place our repos and generates
the paths section of our server configuration file automatically. This
dramatically improved the performance of our server.
Cheers,
Angel
More information about the Mercurial
mailing list