Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Dec 2005 10:59:38 +1100
From:      Michael Vince <mv@roq.com>
To:        =?ISO-8859-1?Q?Fr=E9d=E9ric_de_la_Goublaye?= <fredericdelagoublaye@free.fr>
Cc:        freebsd-java@FreeBSD.org
Subject:   Re: performance question
Message-ID:  <4398C8EA.9040204@roq.com>
In-Reply-To: <007301c5fc2b$55c45290$0400a8c0@iava>
References:  <007301c5fc2b$55c45290$0400a8c0@iava>

next in thread | previous in thread | raw e-mail | index | archive | help
I sent an email to you about this for your last post
Here it is below, even though your kind of asking a slightly different 
set of questions, but to answer some of your other questions here I go.

I have tested http Java direct over the Internet with 'ab' and for what 
ever reason it just returns less requests/sec compared to using Apache 
infront of it, one possibility of why this its like that is maybe Java 
uses more CPU time dealing with a higher latency tcp connection.
There are many advantages of running Apache in front of tomcat, such as 
being able to server static data directly, for example just put
ProxyPass        /static/ !
This will not pass anything in the whole static dir to Tomcat and have 
Apache server it directly it self.

I have being using Apache/Tomcat setups in apache 1.3/2.0/2.1/2.2 and 
Tomcats 3.x 4.1.x 5.0.x and 5.5.x
And I believe that the latest Apache 2.2 and Tomcat 5.5.9 are the best 
combination, mod_proxy_ajp for connectors does give best performance but 
your more likely to get the odd few 503 status errors to peoples 
browsers under high load.
Also you can run php in Apache alongside Tomcat.

Old email
Use Apache2.2 which is the latest release stable version of Apache over 
the 2.1 series which are just experimental betas and should never be 
used in an production environment, but the 2.1 series have shown that 
2.2 is really ready to go straight into production use as far as I am 
concerned.

I have been testing with Apache 2.2 which seems to have tons of little 
things that are much better about it over the old 2.0 Apache series, one 
big one is the new built in AJP protocol module for Tomcat, I am using 
Tomcat 5.5.9 which appears to work better with AJP then Tomcat 5.0.x.
As long as you aren't under extreme load AJP gives the best performance 
but if you really push the load on the server you might get 503 status 
errors in Apache logs, but using AJP does perform more requests/sec 
because it uses less CPU over using mod_proxy HTTP style connectors to 
Tomcat.

I use a portupgrade command for the apache22 port to install the proxy 
modules and worker MPM via a single portupgrade command.
portupgrade -RrN -m 'WITH_MPM=worker -DWITH_PROXY_MODULES' 
/usr/ports/www/apache22

Make sure you have 'LoadModule proxy_ajp_module 
libexec/apache22/mod_proxy_ajp.so' enabled in httpd.conf

Then in the virtual host directive of Apache link it with Tomcat 5.5.9 
like so
ProxyPass /javacontext ajp://127.0.0.1:8009/javacontext

Cheers,
Mike

Frédéric de la Goublaye wrote:

> Hi,
>
> I used FreeBSD 6.0.
>
> I need to use Tomcat to serve jsp servlet and database.
> I choose sqlite because the data will also
> be accessible via a local C++ application on the user computer.
>
> I wonder what is the fastest solution :
> - use Tomcat alone on port 80
> - use Tomcat with Apache22
>
> What is the best combination for using Tomcat ?
> Alone or with Apache ?
>
> I know that not using Apache may avoid me from using all nice PHP 
> solutions like phpBB and so on ... also PHP5 can used sqlite
>
> but I still wonder what is the fastest solution.
>
> Thanks for help
>
> Frédéric
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4398C8EA.9040204>