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

Jim Abramson jabramson at wgen.net
Mon Dec 15 12:02:45 EST 2003


I did think of that, a microsecond after clicking 'send' on my post.

To verify, when I get a chance I will tail the zope log while performing the test to see when the 3rd request arrives at Zope - when I send it, or when the first request wraps up.

On the other hand, it still doesn't explain why the results indicate a block even if the same zope instance is addressed differently in two windows, or against two distinct instances (served from under completely different virtual hosts behind apache). But I will attempt to get more precise results for the different permutations.


> -----Original Message-----
> From: Matthew T. Kromer [mailto:matt at zope.com]
> Sent: Monday, December 15, 2003 11:48 AM
> To: Jim Abramson
> Cc: zope-db at zope.org; Dieter Maurer
> Subject: Re: [Zope-DB] 2 sql methods issue (was Re: SQL Relay)
> 
> 
> 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