You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ge...@gta-travel.com on 2007/08/03 11:50:38 UTC
worker.lock property question.
Hi
The documentation states the following about the lock property.
Specifies what lock method the load balancer will use for synchronizing
shared memory runtime data. If lock is set to O[ptimistic] balancer will not
use shared memory lock to find the best worker. If set to P[essimistic]
balancer will use shared memory lock. The balancer will work more accurately
in case of Pessimistic locking, but can slow down the average response time.
How does the balancer find the best worker if set to optimistic? Reading the
documentation it seems that using pessimistic is the only accurate way of
doing load balancing if you are willing to take a performance hit.
I am not sure how method and locking properties relate to one another.
It would be really great if someone could expand a bit more on this property
and implications.
Regards
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Re: worker.lock property question.
Posted by Mladen Turk <ml...@gmail.com>.
Gerhardus.Geldenhuis@gta-travel.com 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org