[EMAIL PROTECTED] wrote:

It would be really great if someone could expand a bit more on this property
and implications.


Mod_jk has a shared data that gets read/updated from multiple
concurrent threads/processes.
It depends on the web server and in case it's Apache httpd, on mpm used.
With Optimistic locking the sync is done on per thread basis, while
with Pessimistic, it's done as global lock.
The first means that the data is assured to be valid across the threads
in the child process, while the other assures that for all clients.

If using prefork mpm the only solution is to use the Pessimistic locking.

However it all depends how much accuracy you need from load balancer.
If you can live with 20% error, the locking itself is irrelevant.

On Apache httpd for windows or netware that are pure threaded, the
Optimistic (thread) is enough.
With Apache httpd using worker mpm (semi threaded) you can choose
between O and P. Optimistic will be fine cause the total error is
divided by the ThreadsPerChild (the higher the number, the lower the error).

Pessimistic locking should be used for prefork mpms and in situations
where you have spikes of burst load.

Each locking makes the things works slower although we done lots of
optimizations to keep the time inside locks as low as possible.
Mod_jk locks only during reading and storing data to the shared memory,
so that other childs/clients has correct data.
However it depends on the OS and it's implementation of the locking,
on the fact weather you have lock file on the NFS share, etc...

So, since locking is tuning parameter it depends on many things,
and as word tunning suggests, it pretty much empirical.

Regards,
Mladen

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to