You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2007/09/18 19:36:57 UTC

Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rainer,

So, I dumped my configuration entirely and tried to get something served
from somewhere other than the default virtual host.

It turns out that the default virtual host does not set a ServerName,
which apparently really confuses Apache httpd 2.2. Either this was not a
problem for Apache httpd 2.0, or I configured it so long ago that I
don't remember doing it.

Everything started working again when I simply set the ServerName in the
default virtual host to:

ServerName my.ip.address:80

What a PITA.

I still have a few questions, though:

1. I still get the JkShmFile error (didn't specify such a directive;
   should I? If I don't need it, can I disable the feature to avoid
   the error message?)

2. Is is okay to have connection_pool_size=1 for my workers? The docs
   suggest to me that it /must be/ set to 1 if I'm using prefork MPM.

3. How much of this crap can I get rid of:

worker.worker3.type=ajp13
worker.worker3.host=localhost
worker.worker3.port=8385
worker.worker3.lbfactor=50
worker.worker3.connection_pool_size=1
worker.worker3.connection_pool_timeout=60
worker.worker3.socket_keepalive=1
worker.worker3.socket_timeout=300

Clearly, I can eliminate the lb_factor as I am not using load balancing
of any kind. The pool and socket config are just grandfathered-in, so
I'd appreciate any thoughts you have on that, Rainer.

Once again, thanks for taking the time to read through my posts. You
always seem to be willing to look at anyone's debugging output to help
prove that mod_jk isn't the problem ;) Vielen dank!

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8Ay59CaO5/Lv0PARAsPLAJ9GsWkgQIJ/dbw2lbDqkB9Qz6mjhgCfYKlY
6f1QFeYBa/DVKvRCUgMdXzo=
=mscb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

Posted by Rainer Jung <ra...@kippdata.de>.
Christopher Schultz wrote:
> Rainer Jung wrote:
>>> 2. Is is okay to have connection_pool_size=1 for my workers? The docs
>>>    suggest to me that it /must be/ set to 1 if I'm using prefork MPM.
>> OK, I see, that our wording is still not clear. What we try to tell the
>> users:
> 
> I think I get it. Basically, the best practice is to leave this setting
> to the default (when using Apache httpd) unless there's some kind of
> problem. Is that about it?

Yes. The only thing one can do is to decrease the value from the 
default. For prefork, there is no useful value smaller than the default 
"1", for worker there could be, but the implications of decreasing are 
dificult to understand.

>>> worker.worker3.connection_pool_timeout=60
>> OK. Maybe a little short. 600 (10 minutes) should be OK as well. It
>> would be good to adjust connectionTimeout in the Tomcat AJP connector to
>> the same value (multiplied by 1000, because it's milliseconds there). We
>> proudly present the new docs page
>> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.
> 
> 60 seconds ought to be enough for a localhost connection to pick up the
> phone, no? If a web user has to wait 60 seconds, they're going to hit
> RELOAD anyway.

This is not a reply timeout. This timeout means: if mod_jk detects a 
backend connection, which was not used during the last XXX seconds, then 
shut it down. mod_jk uses persistent backend connections, we don't want 
to open a backend connection for each new request. But of course load is 
increasing and decreasing, so if you have more backend connections than 
you need for a long time, it would be OK, to shut them down (each 
backend connections needs a separate thread inside tomcat, even if there 
are no requests handled).

Regards,

Rainer

---------------------------------------------------------------------
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


Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rainer,

Rainer Jung wrote:
>> I still have a few questions, though:
>>
>> 1. I still get the JkShmFile error (didn't specify such a directive;
>>    should I? If I don't need it, can I disable the feature to avoid
>>    the error message?)
> 
> I'm afraid we didn't prepare for that case :(

No problem. I'll explicitly set this to a file that Apache actually has
access to.

>> 2. Is is okay to have connection_pool_size=1 for my workers? The docs
>>    suggest to me that it /must be/ set to 1 if I'm using prefork MPM.
> 
> OK, I see, that our wording is still not clear. What we try to tell the
> users:

I think I get it. Basically, the best practice is to leave this setting
to the default (when using Apache httpd) unless there's some kind of
problem. Is that about it?

>> 3. How much of this crap can I get rid of:
[snip]
>> worker.worker3.lbfactor=50
> 
> Only needed if used in combination with an lb worker *and* you want to
> use different values for the members of the lb.

Ok.

>> worker.worker3.connection_pool_timeout=60
> 
> OK. Maybe a little short. 600 (10 minutes) should be OK as well. It
> would be good to adjust connectionTimeout in the Tomcat AJP connector to
> the same value (multiplied by 1000, because it's milliseconds there). We
> proudly present the new docs page
> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.

60 seconds ought to be enough for a localhost connection to pick up the
phone, no? If a web user has to wait 60 seconds, they're going to hit
RELOAD anyway.

>> worker.worker3.socket_keepalive=1
> 
> OK, in case there is a firewall between your httpd and the backend. As
> long as the backend is localhost, it's unlikely you need it.

Ok.

Again, thanks so much for your continued patience nd help.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8Cpy9CaO5/Lv0PARAmMdAJ4o0QM1zrcNXgzyqqGH4JMIYjj7FgCcCsPK
sd7IhEw6YWQlM7l9JEzNUM8=
=Nt6F
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


Re: mod_jk and Apache httpd 2.2 [RESOLVED ; still have questions]

Posted by Rainer Jung <ra...@kippdata.de>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Rainer,
> 
> So, I dumped my configuration entirely and tried to get something served
> from somewhere other than the default virtual host.
> 
> It turns out that the default virtual host does not set a ServerName,
> which apparently really confuses Apache httpd 2.2. Either this was not a
> problem for Apache httpd 2.0, or I configured it so long ago that I
> don't remember doing it.
> 
> Everything started working again when I simply set the ServerName in the
> default virtual host to:
> 
> ServerName my.ip.address:80
> 
> What a PITA.

Good to know.

> I still have a few questions, though:
> 
> 1. I still get the JkShmFile error (didn't specify such a directive;
>    should I? If I don't need it, can I disable the feature to avoid
>    the error message?)

I'm afraid we didn't prepare for that case :(
See my other mai, why it might be interesting even without real load 
balancing to use the shared memory. If you don't like it, I'm afraid at 
the moment you will have to live with the sartup error.

> 2. Is is okay to have connection_pool_size=1 for my workers? The docs
>    suggest to me that it /must be/ set to 1 if I'm using prefork MPM.

OK, I see, that our wording is still not clear. What we try to tell the 
users:

- this attribute is automatically configured for Apache httpd and all 
MPMs. The default is the number of threads per process, so that each 
request handling thread should be able to use a backend connection 
whenever it needs one.

- for other web servers the default is either 1 or 250 (IIS)

- You might choose non-default values. Using bigger values than the 
default for Apache httpd doesn't make sense, it will simply waste 
ressources. Especially it does not make sense to use a bigger value than 
the default "1" for httpd 1.3 and 2.x/prefork MPM.

If you find a better wording for the workers.properties docs page than 
the existing, please privide us with it :)

> 3. How much of this crap can I get rid of:

> worker.worker3.type=ajp13

Default, but I would stick with it to make it more readable.

> worker.worker3.host=localhost

Default, but again I would keep it, because it's not unlikely, that you 
will move the backend away one day.

> worker.worker3.port=8385

Needed.

> worker.worker3.lbfactor=50

Only needed if used in combination with an lb worker *and* you want to 
use different values for the members of the lb.

> worker.worker3.connection_pool_size=1

Default and better to drop the explicit configuration. Once you switch 
to a multi-threaded MPM, this value (1) is most likely not what you 
want. The default gets automatically adapted to the value of threads per 
process.

> worker.worker3.connection_pool_timeout=60

OK. Maybe a little short. 600 (10 minutes) should be OK as well. It 
would be good to adjust connectionTimeout in the Tomcat AJP connector to 
the same value (multiplied by 1000, because it's milliseconds there). We 
proudly present the new docs page 
http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.

> worker.worker3.socket_keepalive=1

OK, in case there is a firewall between your httpd and the backend. As 
long as the backend is localhost, it's unlikely you need it.

> worker.worker3.socket_timeout=300

Difficult to judge. Socket timeouts help in some situations and make 
things more difficult to understand in oter situations. You could keep it.

> Clearly, I can eliminate the lb_factor as I am not using load balancing
> of any kind. The pool and socket config are just grandfathered-in, so
> I'd appreciate any thoughts you have on that, Rainer.
> 
> Once again, thanks for taking the time to read through my posts. You
> always seem to be willing to look at anyone's debugging output to help
> prove that mod_jk isn't the problem ;) Vielen dank!

Gern geschehen.

Unfortunately somtimes still mod_jk is the problem. But it looks like 
such cases are few these days.

> - -chris

Regards,

Rainer

---------------------------------------------------------------------
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