ActivePython/IIS Request Concurrency

Robert Brewer fumanchu at amor.org
Mon Oct 4 19:10:24 CEST 2004


Erik Rose wrote:
> It seems that the combination of ActivePython, ASP, and IIS 
> is incapable of processing multiple HTTP requests at a time.
> Am I insane? Is this, perhaps, a configuration issue on my end?
> 
> Here's the test code that brought me to this conclusion:
> 
> <%@ Language = Python %>
> <%
> def slow():
>      for i in range(100000):
>          j = i * i;
>      return 'Wow, that took forever!!!';
> 
> Response.write(slow());
> %>
> 
> I dumped the above into a file called slow.asp, yielding a page that 
> takes about 7 seconds to load. When I load slow.asp in two browser 
> windows approximately simultaneously, one of them loads 7 
> seconds after 
> the other. If they were running concurrently, I would expect them to 
> both load almost simultaneously, after about 14 seconds. I 
> got the same 
> results using a time.sleep(10) call instead of the above 
> CPU-heavy loop. 
> Incidentally, a similar test with ActivePerl yields the same results.
> 
> If this limitation is real, it seems to me that this setup is 
> entirely 
> unsuitable for production work, since any page that makes a 
> long-running 
> DB query brings all other request processing to a halt. This would 
> surprise me, though, given the high profile of ActiveState's 
> products in 
> the IIS community. Can anybody give me some good news here? 
> I'm striving 
> valiantly to free my project from the clutches of VBScript 
> but have been 
> thus far foiled. :-)

Insanity is in the mind's eye of the beholder. ;) All I can tell you is
that I don't have that problem. But I'm not using ActivePython, just IIS
+ pywin32. My first thought was that the "application protection"
setting in IIS (process isolation, essentially) might be the culprit,
but I tried all three settings without any difficulties on your script.
:( If you want to put together a list of "likely candidate" IIS settings
and ask me "what's your system set at?", feel free.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list