[PATCH] docker: add Docker files for running an Apache mod_wsgi server
Mads Kiilerich
mads at kiilerich.com
Thu Nov 13 08:52:58 CST 2014
On 11/13/2014 03:18 PM, Augie Fackler wrote:
> On Thu, Nov 13, 2014 at 9:17 AM, Mads Kiilerich <mads at kiilerich.com> wrote:
>>>>> This patch introduces a Docker environment for running Mercurial
>>>>> under Apache + mod_wsgi. With just a few command executions, it is
>>>>> possible to spin up a Docker container running hgweb.
>>>> apache+mod_wsgi+multiple workers ... why not just run hg serve? What is
>>>> it
>>>> you want to test?
>>> I'm assuming he wants to test under a realistic multi-threaded
>>> environment, rather than the phoney no-concurrency variant that hg
>>> serve gives you.
>>
>> hg serve might be phoney, but AFAIK&CS it is multi-threaded. In what wat is
>> it not? I would expect that it would be perfect for reproducing concurrency
>> issues.
> I should have been more precise: modwsgi+many workers provides real
> _concurrency_ in a way that hg serve cannot - yes, we use threads, but
> the GIL means that it's somewhat rare that multiple requests can do
> anything useful.
Yes, there is no simple way to make hg serve use forked workers - but it
seems like it would be simple to add if someone needs it.
But how relevant is it to do testing of concurrency in different forked
worker processes? These workers will only interact through the file
system (and by clients ending up on different workers for different http
requests) and compete over system resources. It will be very rare to
find tricky issues in such setups and it will scale quite linearly.
I would assume that the relevant and hard test is using worker threads
where threads manipulate the same data. That is very likely to find errors.
For all realistic setups using threaded workers, it would have to GIL.
Which will be fine, because it probably will spend most of the time
waiting for IO or compressing/diffing stuff, hopefully without having
the GIL. AFAICS, hg serve provide just as much concurrency as any
'realistic' server setup does.
/Mads
More information about the Mercurial-devel
mailing list