From owner-freebsd-java@FreeBSD.ORG Fri Dec 9 00:00:02 2005 Return-Path: X-Original-To: freebsd-java@FreeBSD.org Delivered-To: freebsd-java@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A708416A425 for ; Fri, 9 Dec 2005 00:00:02 +0000 (GMT) (envelope-from mv@roq.com) Received: from vault.mel.jumbuck.com (ppp166-27.static.internode.on.net [150.101.166.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2925E43DE5 for ; Thu, 8 Dec 2005 23:59:41 +0000 (GMT) (envelope-from mv@roq.com) Received: from vault.mel.jumbuck.com (localhost [127.0.0.1]) by vault.mel.jumbuck.com (Postfix) with ESMTP id ACED78A027; Fri, 9 Dec 2005 10:59:38 +1100 (EST) Received: from [192.168.46.52] (unknown [192.168.46.250]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by vault.mel.jumbuck.com (Postfix) with ESMTP id 911EA8A01F; Fri, 9 Dec 2005 10:59:38 +1100 (EST) Message-ID: <4398C8EA.9040204@roq.com> Date: Fri, 09 Dec 2005 10:59:38 +1100 From: Michael Vince User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.12) Gecko/20051208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Fr=E9d=E9ric_de_la_Goublaye?= References: <007301c5fc2b$55c45290$0400a8c0@iava> In-Reply-To: <007301c5fc2b$55c45290$0400a8c0@iava> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-java@FreeBSD.org Subject: Re: performance question X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2005 00:00:02 -0000 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"