PDA

View Full Version : Process Pooling Failing... Is It Because of Properties?



John Hulsman
22-Jun-2005, 05:03 PM
I've turned Process Pooling on for a web app to increase its efficiency and
we ended up getting some errors I've not seen before on and off after doing
so. My web object has global properties declared in it. Do I need to work
around using properties because of this? Its the only thing I can think of,
and I was wondering if that could be the reason. The application worked
fine before with the Process Pooling off, its just this app gets hit quite
frequently and I'd like to cut the number of EXEs open simultaneously down a
little bit to make things easier on the server.

Thanks in advance
John

Nick Wright
22-Jun-2005, 09:53 PM
John,

You should not employ global properties in a webapp with Process Pooling.

You have to think of the server holding a pool of programs (processes), each
request from a client is shared out amongst the processes in the pool, if
one process is busy it will grab another, as each process finishes it is
returned to the pool.

You cannot guarantee that one request from a client is going to use the same
program as the very next request from the same client, hense if the first
request sets a property, the property will not persist if the next request
is sent to another process.

All requests from the client should contain enough information for the
process to be processed from scratch. A bit of a pain to convert your
existing app but having done it myself the benefits are worth it.
During average peak daily traffic we have over 40 concurrent session
serviced by a pool of 5 processes, no problems at all.

Good luck

Nick
http://www.legendmemory.com/shop/

"John Hulsman" <jhulsman@jasperengines.com> wrote in message
news:b99eHZ3dFHA.1112@dacmail.dataaccess.com...
> I've turned Process Pooling on for a web app to increase its efficiency
> and
> we ended up getting some errors I've not seen before on and off after
> doing
> so. My web object has global properties declared in it. Do I need to
> work
> around using properties because of this? Its the only thing I can think
> of,
> and I was wondering if that could be the reason. The application worked
> fine before with the Process Pooling off, its just this app gets hit quite
> frequently and I'd like to cut the number of EXEs open simultaneously down
> a
> little bit to make things easier on the server.
>
> Thanks in advance
> John
>

Evertjan Dondergoor
27-Jun-2005, 06:26 AM
Hello John,

You have to make sure properties have the right value. This means you cannot
set the value of a propertie in one request, and assume it is stil the same
in the next request. It is the same as with record-buffers. You should do a
clear or a find with each request, and not assume the 'correct' record is in
the buffer.

Btw, this also applies when you do not use process-pooling, but with process
pooling it is more likely to go wrong.

Evertjan

"John Hulsman" <jhulsman@jasperengines.com> wrote in message
news:b99eHZ3dFHA.1112@dacmail.dataaccess.com...
> I've turned Process Pooling on for a web app to increase its efficiency
> and
> we ended up getting some errors I've not seen before on and off after
> doing
> so. My web object has global properties declared in it. Do I need to
> work
> around using properties because of this? Its the only thing I can think
> of,
> and I was wondering if that could be the reason. The application worked
> fine before with the Process Pooling off, its just this app gets hit quite
> frequently and I'd like to cut the number of EXEs open simultaneously down
> a
> little bit to make things easier on the server.
>
> Thanks in advance
> John
>

Anders Öhrt
27-Jun-2005, 06:55 AM
> Btw, this also applies when you do not use process-pooling, but with
> process
> pooling it is more likely to go wrong.

That's not true. Without PP, you get the same process on each call, so you
can safely use properties between page requests.

// Anders

wila
27-Jun-2005, 07:45 AM
Anders,

Anders Öhrt wrote:
>>Btw, this also applies when you do not use process-pooling, but with
>>process
>>pooling it is more likely to go wrong.
>
> That's not true. Without PP, you get the same process on each call, so you
> can safely use properties between page requests.

[WvA] True... unless your page timed out in the meantime as then your
properties have lost their value again..
One thing you can really count on your endusers to find in due time. ;)

--
Wil

>
> // Anders
>
>

Evertjan Dondergoor
27-Jun-2005, 07:56 AM
Like Wil mentions, timeouts can occur. In that case you dont get the same
process, but a new process will be created.

Evertjan

"Anders Öhrt" <Anders.Ohrt@capslock.se> wrote in message
news:uLj7M%23weFHA.3408@dacmail.dataaccess.com...
>
>> Btw, this also applies when you do not use process-pooling, but with
>> process
>> pooling it is more likely to go wrong.
>
> That's not true. Without PP, you get the same process on each call, so you
> can safely use properties between page requests.
>
> // Anders
>

Anders Öhrt
27-Jun-2005, 08:55 AM
> [WvA] True... unless your page timed out in the meantime as then your
> properties have lost their value again..
> One thing you can really count on your endusers to find in due time. ;)

Yes, but then you probably have a login-system that throws the user out and
required revalidation. You never "magically" lose properties, like you can
with PP where you test with a single session and everything appears to work,
but instantly breaks when deployed.

// Anders

wila
27-Jun-2005, 09:40 AM
Anders,

Anders Öhrt wrote:
>>[WvA] True... unless your page timed out in the meantime as then your
>>properties have lost their value again..
>>One thing you can really count on your endusers to find in due time. ;)
>
>
> Yes, but then you probably have a login-system that throws the user out and
> required revalidation. You never "magically" lose properties, like you can
> with PP where you test with a single session and everything appears to work,
> but instantly breaks when deployed.

[WvA] Well... ofcourse i knew you knew about that feature and maybe i
should have added that to my remark :)

But for others reading this, it is important to point out that there is
another reason to develop for persistence even without PP turned on and
that is session termination due to time outs which can happen anywhere.

--
Wil
>
> // Anders
>
>

John Hulsman
12-Jul-2005, 11:40 AM
I've done a little debugging and found some incorrect code hiding that was
causing the hanging problem and in-turn the problem with the applications
terminating correctly. Hard telling how it got in there, but there were a
two IF statements that were referencing a file that was not open and in
which the record desired was not found yet. Moving these incorrectly placed
IF statements down into the FIND corrected the problem. While I still
intend to upgrade to a newer version of VDF to get passed the bug with
abnormal termination, I had to find out why it was terminating this way.
Thanks for everyone's input on this.

"John Hulsman" <jhulsman@jasperengines.com> wrote in message
news:b99eHZ3dFHA.1112@dacmail.dataaccess.com...
> I've turned Process Pooling on for a web app to increase its efficiency
> and
> we ended up getting some errors I've not seen before on and off after
> doing
> so. My web object has global properties declared in it. Do I need to
> work
> around using properties because of this? Its the only thing I can think
> of,
> and I was wondering if that could be the reason. The application worked
> fine before with the Process Pooling off, its just this app gets hit quite
> frequently and I'd like to cut the number of EXEs open simultaneously down
> a
> little bit to make things easier on the server.
>
> Thanks in advance
> John
>