tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: mod_jk JkShmFile directive
Date Mon, 24 Sep 2007 14:05:36 GMT wrote:
> My questions
> ~~~~~~~~~~~~
> Is this shared memory used by different child apache processes on the same
> machine or is it a bit more involved than that.

Yes, its simply that.
The shared memory contains configuration and runtime information for 
load balancer workers and their members. We need it in order that
- all apache children share the same status information for load 
balancing members (OK, ERROR, ...). Before shm, each child had to detect 
an error by itself (possibly burning requests etc.)
- share the information about load taken by the individual workers. 
Before shm, each child had its own load counter, leading to very bad 
balancing behaviour under small load
- share the information for the parts of the configuration, which are 
changeable during runtime by the status worker

The shm is used by balancer and status workers.

> If the answer to the above question is yes, do you really need this in the
> config. What value does it add to have this directive available, except for
> the fact that you can specify the location...

No other value. I think this value is enough. You usually want to place 
this file in a "run" directory, where e.g. the pid files go etc. Also 
the file should not be on NFS (I guess), so hard coding SERVERROOT/logs 
is not enough.

> I would also kind of expect the JkShmSize directive to be automatic instead
> of having to specify it. If it needs to be bigger than the default 64Kb it
> should grow on its own accord.

Yes, that would be nice. Unfortunately this requires a little code 
surgery and not only a small patch, because at the moment the shm is 
statically acquired (fixed size) and we need it before we parse the 
worker configuration, so beforee we know, how many workers we have. To 
fix that, we would either need to count the workers in a separate pass 
in advance, or enhance the shm handling to allow growth of it.

At the moment we initialize the shm for 64 workers, which on some 
platforms lead to 28800 Bytes size. Actually I'm not sure, if we will 
really be able to use 64 workers, or if the number is slightly smaller 
(63?), because we might need to subtract some offset size used as a header.

> Regards



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message