Alaska Software Inc. - WAA memory consumption & service times
Username: Password:
AuthorTopic: WAA memory consumption & service times
Vladimir IahnencoWAA memory consumption & service times
on Tue, 14 Sep 2004 00:14:11 -0400
Hi All,
Run into an issue.
I have a waa form with the "meta refresh" tag inside. To attack  the
server I set refresh to 10 sec, i.e my page get refreshed after 10 sec and
every 10 sec waa server executes the same form & code. I made two
experiments with:
1. Remote - Win2000+WAA
2. LocalHost WinXP+WAA

In the Win2000 case the first service time was about 4 sec and waa allocated
about 15M of memory. After some number requests (say about 30) service time
increased to about 15 sec and waa grabbed another 15MB memory. Finally this
resulted to 100% machine resource consumption and waa wasn't able to handle
requests. I also tested that with another Win2000 remote pc and got the same
picture. I gave some relax to the waa server to give it chance to start the
garbage collector. That didn't help, service time continued to increase.

In the localhot case I didn't get such behaviour, waa memory consumption
jumped from 15,5M to 16,5M and waa worked fine.

To access the package global variables I created a class with CLASS VARS to
store them. I widely used it in all waa_forms and related function like
    LOCAL oVars := MyVars():New(oHtml, oContext)
    LOCAL cPath := oVars:GetString("MyPath" )

I found waa doesn't like this approach and the most aggressive memory
consumption I noticed when I used detached class object creation like
    RETURN MyVars():New():GetString("MyVar")

Did  anybody get such issue, thoughts, advices?

Thanks in advance


Vladimir
Phil Ide
Re: WAA memory consumption & service times
on Tue, 14 Sep 2004 09:49:12 +0100
Vladimir,

> To access the package global variables I created a class with CLASS VARS to
> store them. I widely used it in all waa_forms and related function like
>     LOCAL oVars := MyVars():New(oHtml, oContext)
>     LOCAL cPath := oVars:GetString("MyPath" )
> 
> I found waa doesn't like this approach and the most aggressive memory
> consumption I noticed when I used detached class object creation like
>     RETURN MyVars():New():GetString("MyVar")
> 
> Did  anybody get such issue, thoughts, advices?

1.  I reset WAA twice a day using Windows Scheduler, at 6am and 6pm.  This
is to resolve the memory leak issue which is associated with the WAA
console (which may in fact have been resolved in 1.82, but I still do it
anyway).

2.  I use a similar method to yourself to store oHtml, oContext, HAL and
Package objects in a thread-local STATIC variable.  It is imperative that
this variable be set to NIL before your form-func returns control to WAA!

3.  My form-funcs are required to collect masses of data.  They do this
incrementally using some simple logic:

If I don't have this_portion_of_data, get input and return else display it
and get next portion.

This way, the same function is called about 10 times for a single user to
complete a full form.  Checking my stats, I see that one (remote) client
used the same function just over 3000 times in 8 hours, and I don't see any
problems like you describe.

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

"Bother," said Pooh, and called in an air strike.
Vladimir IahnencoRe: WAA memory consumption & service times
on Tue, 14 Sep 2004 10:12:14 -0400
Thanks, Phl,
Couple more questions:
1. Are you using CLASS VARs or STATICs accessible through SetGet function. I
zeroized all my objects with CLASS VARS and I still could see increasing.

2.I'm using xBase classes to build the html like
    LOCAL oTable := WebTable():New()
     oTable:SetData(...........
Do I have to set this objects also to NIL before return from the form or waa
will clean them up?

3. Did you mansion any server RAM requirements. I tested on a system with
Win2000 and 256M RAM. Could that affect the garbage collector in some way?
--
Regards,

Vladimir


"Phil Ide" <phil@idep.org.uk> wrote in message
news:1rqrj316ajwj0.dlg@idep.org.uk...
> Vladimir,
>
> > To access the package global variables I created a class with CLASS VARS
to
> > store them. I widely used it in all waa_forms and related function like
> >     LOCAL oVars := MyVars():New(oHtml, oContext)
> >     LOCAL cPath := oVars:GetString("MyPath" )
> >
> > I found waa doesn't like this approach and the most aggressive memory
> > consumption I noticed when I used detached class object creation like
> >     RETURN MyVars():New():GetString("MyVar")
> >
> > Did  anybody get such issue, thoughts, advices?
>
> 1.  I reset WAA twice a day using Windows Scheduler, at 6am and 6pm.  This
> is to resolve the memory leak issue which is associated with the WAA
> console (which may in fact have been resolved in 1.82, but I still do it
> anyway).
>
> 2.  I use a similar method to yourself to store oHtml, oContext, HAL and
> Package objects in a thread-local STATIC variable.  It is imperative
that
> this variable be set to NIL before your form-func returns control to WAA!
>
> 3.  My form-funcs are required to collect masses of data.  They do this
> incrementally using some simple logic:
>
> If I don't have this_portion_of_data, get input and return else display it
> and get next portion.
>
> This way, the same function is called about 10 times for a single user to
> complete a full form.  Checking my stats, I see that one (remote) client
> used the same function just over 3000 times in 8 hours, and I don't see
any
> problems like you describe.
>
> Regards,
> --
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> "Bother," said Pooh, and called in an air strike.
Eka MuratovaRe: WAA memory consumption & service times
on Wed, 15 Sep 2004 10:16:40 +0800
Hi Vladimir!
[..]
> 3. Did you mansion any server RAM requirements. I tested on a system with
> Win2000 and 256M RAM. Could that affect the garbage collector in some way?
  Yes of course. Alaska's GC do some thing different depending on
installed/free RAM. For example, GC tries to do defragmentation (not
collecting!) more often if alloced more then half of installed RAM.

Eka Muratova
www.eleussoft.narod.ru
Butch BalascoRe: WAA memory consumption & service times
on Tue, 14 Sep 2004 12:55:50 -0400
Phil,
can you tell me how you set windows scheduler to perform reset of WAA twice
a day..
thanks,
butch balasco

"Phil Ide" <phil@idep.org.uk> wrote in message
news:1rqrj316ajwj0.dlg@idep.org.uk...
> Vladimir,
>
> > To access the package global variables I created a class with CLASS VARS
to
> > store them. I widely used it in all waa_forms and related function like
> >     LOCAL oVars := MyVars():New(oHtml, oContext)
> >     LOCAL cPath := oVars:GetString("MyPath" )
> >
> > I found waa doesn't like this approach and the most aggressive memory
> > consumption I noticed when I used detached class object creation like
> >     RETURN MyVars():New():GetString("MyVar")
> >
> > Did  anybody get such issue, thoughts, advices?
>
> 1.  I reset WAA twice a day using Windows Scheduler, at 6am and 6pm.  This
> is to resolve the memory leak issue which is associated with the WAA
> console (which may in fact have been resolved in 1.82, but I still do it
> anyway).
>
> 2.  I use a similar method to yourself to store oHtml, oContext, HAL and
> Package objects in a thread-local STATIC variable.  It is imperative
that
> this variable be set to NIL before your form-func returns control to WAA!
>
> 3.  My form-funcs are required to collect masses of data.  They do this
> incrementally using some simple logic:
>
> If I don't have this_portion_of_data, get input and return else display it
> and get next portion.
>
> This way, the same function is called about 10 times for a single user to
> complete a full form.  Checking my stats, I see that one (remote) client
> used the same function just over 3000 times in 8 hours, and I don't see
any
> problems like you describe.
>
> Regards,
> -- 
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> "Bother," said Pooh, and called in an air strike.
Phil Ide
Re: WAA memory consumption & service times
on Wed, 15 Sep 2004 11:55:58 +0100
Butch,

> can you tell me how you set windows scheduler to perform reset of WAA twice
> a day..
> thanks,

Nothing simpler.

1.  Create a form-function with a really wierd name (so it is unlikely that
anyone will find it by accident):

Function IWillDieForYouIfYouAskNicely( oHtml, oContext )
   CLOSE DATABASES
   QUIT
   RETURN TRUE

2.  Write a mini-app to call this function:

Function Main()
   local cUrl := 'http://localhost/cgi-bin/waa1gate.exe?'+;
                 'WAA_PACKAGE=MyPackage&'+;
                 'WAA_FORM=IWillDieForYouIfYouAskNicely'

   LoadFromUrl( cUrl )
   RUN 'StartWaa.bat'
   return

3.  Create a schedule in Windows Scheduler to call your mini-app.

If you want extra security, you can test the IP address of the callee in
IWillDieForYouIfYouAskNicely to make sure the callee is '127.0.0.1'.

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

Caesarean Section: A district in Rome
Butch BalascoRe: WAA memory consumption & service times
on Wed, 15 Sep 2004 18:09:35 -0400
Thanks Phil
butch
"Phil Ide" <phil@idep.org.uk> wrote in message
news:11wruqqrh4s6t$.dlg@idep.org.uk...
> Butch,
>
> > can you tell me how you set windows scheduler to perform reset of WAA
twice
> > a day..
> > thanks,
>
> Nothing simpler.
>
> 1.  Create a form-function with a really wierd name (so it is unlikely
that
> anyone will find it by accident):
>
> Function IWillDieForYouIfYouAskNicely( oHtml, oContext )
>    CLOSE DATABASES
>    QUIT
>    RETURN TRUE
>
> 2.  Write a mini-app to call this function:
>
> Function Main()
>    local cUrl := 'http://localhost/cgi-bin/waa1gate.exe?'+;
>                  'WAA_PACKAGE=MyPackage&'+;
>                  'WAA_FORM=IWillDieForYouIfYouAskNicely'
>
>    LoadFromUrl( cUrl )
>    RUN 'StartWaa.bat'
>    return
>
> 3.  Create a schedule in Windows Scheduler to call your mini-app.
>
> If you want extra security, you can test the IP address of the callee in
> IWillDieForYouIfYouAskNicely to make sure the callee is '127.0.0.1'.
>
> Regards,
> -- 
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> Caesarean Section: A district in Rome