clearing up issues around jsvc or jakarta commons daemon

Michael Vince mv at roq.com
Fri Mar 31 06:07:21 UTC 2006


Tim Diggins wrote:

> Hi -
>
> having googled and read around, there seems to be an approach to 
> jakarta commons daemon (jsvc) that I don't understand. There is no 
> FreeBSD port of it (there are darwinports and other OSX ports, however).
>
> The last discussion of this  [1] simply states - "you must use .... 
> (apache + mod_webdav/mod_proxy/mod_jk)" -- no discussion of why...
>
> However almost all *recent* informed discussion in the tomcat world 
> suggests that one should never just blindly serve tomcat behind 
> apache, unless there is reason to - instead you serve your application 
> both ways, profile them both and choose the optimal solution (many 
> times standalone tomcat is more appropriate, even with lots static files)

I seriously disagree, I have done extensive benchmarking using 
apachebenchmark 'ab' and other self developed tests and found that using 
proxy_ajp_module to seriously help performance sometimes by magnitudes 
of requests / sec for a Tomcat 5.5.x / Apache 2.2 setup

Its very simple to do with the Apache2.2 server and you get all the 
extra power that Apache provides.

Simply build apache with the proxy modules.
Simply use the portupgrade -N -m 'WITH_MPM=worker -DWITH_PROXY_MODULES' 
/usr/ports/www/apache22

And put something like this in your Apache virtual host config Allow 
apache to pass over the servlets-examples to Tomcat.
ProxyPass /servlets-examples ajp://127.0.0.1:8009/servlets-examples

With this kind of setup you can can allow Apache to send static data 
directly offloading Tomcat to just work on dynamic data
ProxyPass        /images/ !

And use other Apache2.2 performance features such as mod_mem_cache for 
memory caching of static content to lower hard drive IO.
|http://httpd.apache.org/docs/2.2/mod/mod_cache.html|

With these kinds of settings believe it or not I am able to deliver 100s 
of millions of dynamic page loads a month on a single Pentium 4 server.


More information about the freebsd-java mailing list