Re: athena eats my cpu

Jean-Paul Calderone <[email protected]> Tue, 4 Sep 2007 10:48:35 -0400
Newsgroups gmane.comp.python.quotient.dev
Message-ID <20070904144835.8162.1937028527.divmod.quotient.3600@ohm>
On Tue, 04 Sep 2007 16:25:32 +0200, Werner Thie <[email protected]> wrote:
>Hello Jean-Paul
>
>Thxs for your time
>>>Load: 1 client / one round
>>>1339223 function calls (1288601 primitive calls) in 178.951 CPU secs
>
>>>Load: 3 clients / ten rounds each
>>>33541459 function calls (33103528 primitive calls) in 859.489 CPU secs
>
> >> 3 clients doing 10 rounds each, but your profile shows 4 times this >> 
>many
>Eh?? 33541459 / 1339223 = 25.05
>Not 30 because of the system becoming already slow (the figures are from a 
>VMWare based BSD installation, clients on the same machine.

Oops, yes.  And you even did the math I was trying to do, correctly, in your
original message. :)

>>Do your clients interact with each other, or are they each independent?
>Completely ndependent, if you want to have a look see
>
>http://sf.jassportal.ch/differenzler?uid=gast
>>You
>>might also want to look at the actual payloads of the HTTP requests Athena
>>is making.  There may be a bug where it sends more an more irrelevant or
>>duplicate data as time goes on.  Firebug is somewhat handy for this kind of
>>inspection.
>Thxs for the suggestion, the amount of cumulated traffic in the browser is 
>according to what we expect.
>
>What I observe is that for every athena call I make I see several
>
>appserver.py::handlesegment calls, which in turn creates in line 290 a new 
>PageContext.

Yes.  A lot of context objects are created and this can sometimes be
prohibitively expensive.  One goal we have for Nevow is to eliminate
the context objects entirely, but that's still a ways off.

>Q: why is every POST recorded as a new resource?

Just like with GET requests, the Resource for the URL of the POST request
needs to be located so that it can handle the POST request.

>The context.py::PageContext.__init__ now updates the toremember attr and the 
>one of my LivePage grows ad inifinitum and this is what is eating my CPU

Are you explicitly using the toremember feature in your application?  If
so, you may want to find a way to avoid using it.  If not, then this may
be a bug in Nevow's renderer.  If you can provide an example of a Nevow
application which triggers this, we might be able to fix it.

Jean-Paul