[Zope-DB] 2 sql methods issue (was Re: SQL Relay)

Matthew T. Kromer matt at zope.com
Mon Dec 15 11:48:08 EST 2003


Actually, I'd bet this is more like your browser restricting the number 
of streams it will open to a given web site simultaneously.

Normally a browser will use at most four streams to any one site.  It 
sounds kind of like your browser is behaving funny and not loading a 
second page until the first page completes loading (probably to be 
"nice" and not swamp the target site).

On Dec 15, 2003, at 11:32 AM, Jim Abramson wrote:

> Hello, folks, news to report on this peskiness:
>
>>> ...
>>> I've tried splitting the zope-based services we run onto
>> two separate zope instances, on the
>>> same server, and unfortunately even in this case zope2
>> will not serve any requests while zope1
>>> is using more than 1 database connection actively (note -
>> i have found that any action involving
>>> a zope db connection, not just a sql method, will cause
>> this hogging situation).
>>
>>
>> Thus, you need to find out, what your Zope2 instance is waiting for.
>>
>> I would use a ("C" level) debugger for this.
>>
>
> I've little working knowledge at this level, nor do I have any time to 
> educate myself about it...(one of the reasons we're using Zope after 
> all.) However I recently performed a variant on my earlier 
> quick-and-dirty test, and found out that the problem is not what it 
> seemed.
>
> I will explain the test I performed and hope that someone out there 
> can explain this interesting behavior. It's no less confusing - just 
> (apparently) not the offender I'd thought it to be.
>
> setup:
>
> 1. I set up an oracle proc which sleeps for 10 seconds and then 
> returns. Instantiated a DCOracle2 SP object in zope. Wrote a dtml page 
> called 'db' that dtml-calls the SP, then prints a message.
>
> 2. Set up another dtml page called 'nodb' that just prints a message - 
> no db activity whatsoever.
>
> 3. Open 3 browser windows on the client machine.
>
> test:
>
> 1. in the first 2 browser windows, call 'db' page, then in the third, 
> call 'nodb'. Notice that 'nodb' does not respond until the first 'db' 
> page gets its response from Oracle and returns html. Thus, the 
> apparent blocking situation.
>
> (note that the above situation can be reproduced in a wide range of 
> variations, including:
>
>  - address zope differently in the first two browser windows that call 
> 'db'. For example, in one I call zope by http://publiczopeaddress and 
> in the other through a port-forwarded ssh tunnel as 
> http://localhost:8888. Same results.
>
>  - instantiate the test zope stuff on 2 different zope instances 
> running on the same server, call 'db' in the first browser window from 
> zopeinstance1 and in the second fromn zopeinstance2. Same results! 
> this is what really blew me away.)
>
> Now,
>
> 2. Open a _different_ browser on the client machine, and substitute 
> that for one of the original browser windows. In my case I used an IE 
> window and a NS window to each call 'db' simultaneously. Regardless of 
> whether or not browser1 or browser2 are used as the third window to 
> call 'nodb', guess what: NO BLOCK.
>
> It seems therefore that something in Zope is blocking responses to a 
> single identified client when database activities are in progress, not 
> to one-at-a-time, which seems intuitive enough, but two-at-a-time (the 
> second call to 'db' does not seem to get held up by the first....it's 
> only subsequent requests while the first two are still active which 
> get blocked). At least, that is the best theory I can come up with. 
> Does this somehow fit into the zope worldview of anyone out there, 
> with a deeper knowledge than I?
>
> Jim
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db




More information about the Zope-DB mailing list