Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A473200B59 for ; Mon, 8 Aug 2016 18:18:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 48BFA160A91; Mon, 8 Aug 2016 16:18:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 67F4B160A77 for ; Mon, 8 Aug 2016 18:18:30 +0200 (CEST) Received: (qmail 24395 invoked by uid 500); 8 Aug 2016 16:18:29 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 24384 invoked by uid 99); 8 Aug 2016 16:18:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2016 16:18:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7C61DC0455 for ; Mon, 8 Aug 2016 16:18:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id J_x1e9YKRlyf for ; Mon, 8 Aug 2016 16:18:26 +0000 (UTC) Received: from thor.wissensbank.com (thor.wissensbank.com [81.169.250.120]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9B4AA5FC39 for ; Mon, 8 Aug 2016 16:18:25 +0000 (UTC) Received: from thor.wissensbank.com (localhost [127.0.0.1]) by thor.wissensbank.com (Postfix) with ESMTP id BAC3515A600B7 for ; Mon, 8 Aug 2016 18:18:24 +0200 (CEST) Received: by thor.wissensbank.com (Postfix, from userid 500) id A1BBA15A600FD; Mon, 8 Aug 2016 18:18:24 +0200 (CEST) Received: from [192.168.245.129] (pd956abfc.dip0.t-ipconnect.de [217.86.171.252]) (Authenticated sender: andre.warnier@ice-sa.com) by thor.wissensbank.com (Postfix) with ESMTPA id 4258F15A600B7 for ; Mon, 8 Aug 2016 18:18:23 +0200 (CEST) Subject: Re: Connectivity Issue with Tomcat7 and WebServer (AJP Connector) To: users@tomcat.apache.org References: <57A7ADBC.2030006@ice-sa.com> <57A840D4.4050603@ice-sa.com> From: =?UTF-8?Q?Andr=c3=a9_Warnier_=28tomcat=29?= Message-ID: <57A8B0CE.7050602@ice-sa.com> Date: Mon, 8 Aug 2016 18:18:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP archived-at: Mon, 08 Aug 2016 16:18:31 -0000 On 08.08.2016 17:48, Mark Eggers wrote: > Jayaram, > > Please don't top post (http://tomcat.apache.org/lists.html#tomcat-users > item 6). > > On 8/8/2016 2:18 AM, Jayaram Ponnusamy wrote: >> Thanks Andr, >> >> 1. ANS-Question 1 = Both Tomcat & WebServer installed on different >> Machines, Attached Architecture diagram of our environment. Our >> Tomcat are configured as Application Clustering, and WebServer1 is >> pointing to Tomcat1 and WebServer2 is pointing to Tomcat2 Tomcat's IP >> (Node1): 10.100.0.31 WebServer's IP (Node1): 10.100.15.21 >> >> Tomcat's IP (Node2): 10.100.0.32 WebServer's IP (Node2): >> 10.100.15.22 >> >> 2. ANS-Question 2 = Thanks, Thats fine :) >> >> 3. ANS-Question 3 = Attached Architecture diagram for your >> reference. > > Attachments are stripped by the list software. Please do an inline ASCII > diagram. This time though, the diagram made it through, at least for me. It clears things up a bit, but not completely. It is for example unclear to me, why the front-end Apache server (Virtual Host) would have a ServerName matching the IP address of the back-end Tomcat server. ServerName 10.100.0.31 In an Apache httpd configuration, the above seemingly IP-address is not interpreted as an IP address, but as a literal hostname "10.100.0.31". But maybe this has to do with something in the way the top front-end F5 load-balancer works. (?) Also, I can easily see some potential problems due to pages coming back from Tomcat, containing links to the wrong hostname, so that user clicks never make it back to the same front-end F5 and/or Apache. But this is taking us a bit away from the main purpose of this user's list. The OP stated that when they "access Tomcat directly", things are normal. But when they access it "through Apache", then things are slow or not happening. The question is still, what does "accessing through Apache" really mean in this case. The problem could be at various levels, and we don't have access to them all. I'll try to figure out some step-by-step procedure and questions, to guide the OP in finding out where things block. > > Also, in your diagram, please show the location of all involved firewalls. > > . . . just my two cents > /mde/ > >> Thanks Jayaram >> >> On Mon, Aug 8, 2016 at 11:20 AM, Andr Warnier (tomcat) >> wrote: >> >>> On 08.08.2016 09:14, Jayaram Ponnusamy wrote: >>> >>>> Thanks for your Quick & Valuable Response, >>>> >>>> 1. ANS-Question 1: No Both Are different Machine, We are using >>>> VirtualHost configuration >>>> >>> >>> That is not consistent with the configuration that you sent. You >>> have a ServerName (in Apache) named as "ServerName 10.100.0.31" >>> (which is not a proof, but a suggestion that the IP of this machine >>> is 10.100.0.31). And you have this line in workers.properties : >>> worker.prod_live_svr.host=10.100.0.31 which suggest that Tomcat >>> answers to the same address. So why are you saying "different >>> machine" ? >>> >>> 2. ANS-Question 2: Kindly please share Optimal Value to Set for >>>> ConnectionTimeout & KeepAliveTimeout if required >>>> >>> >>> One again, there is no "optimal" value for all cases. But the >>> default values should cover most of the usual cases. The default >>> values are the ones that are active if you do not specify the >>> parameter at all. So just remove these parameters, and you should >>> be ok. If there is a problem such as you mention below, it is NOT >>> because of the default value of these parameters. >>> >>> 3. ANS-Question 3: Yes We have Firewall, but there is no rules. I >>> just >>>> googled and updated this value to tuning server. Now I removed >>>> >>> >>> Can you draw a simple schema of your configuration ? (ASCII-art) >>> Showing clearly : - where is the workstation - where is Apache >>> httpd - where is the firewall - where is Tomcat >>> >>> We do not have access to your server, so it is more complicated >>> for helping you, unless you provide us with precise information. >>> >>> >>> 4. ANS-Question 4: I am new to Apache, While searching in Google, >>> Based on >>>> some recommandationI tried. I removed all these items. >>>> >>>> >>> Good. >>> >>> Now I am monitoring systems, whether still its closing connections >>> or not. >>>> >>>> sir, While directly using Tomcat URL, pages are loading 1-2 >>>> Seconds, but the same page taking 6-7 Seconds in WebServer URL. >>>> Also, If I didn't use WebServer URL for 30minutes and hit any >>>> URL, first time its taking more than 30 Seconds to load a page. >>>> >>>> Is there any option to tuning the system. >>>> >>>> >>> See item 3 above. Clearly, you have a problem. But without knowing >>> your exact configuration, we can only guess. Clearly also, it is >>> not a problem of Tomcat per se. To me, with the little information >>> available so far, it sounds like it could be a problem with DNS or >>> routing, but that's just a wild guess so far. >>> >>> >>> >>> >>>> On Mon, Aug 8, 2016 at 12:53 AM, Andr Warnier (tomcat) >>>> wrote: >>>> >>>> On 07.08.2016 11:08, Jayaram Ponnusamy wrote: >>>>> >>>>> Hi, >>>>>> We are using Tomcat 7.0.42.0, AJP/1.3 with Apache 2.2.21. >>>>>> Connecting Apache to Tomcat as VirtualHost, The Problem is >>>>>> Apache and Tomcat losing its connection every 20-30 Minutes. >>>>>> Either We have to hit the WebServer URL multiple times or >>>>>> Reboot Apache & Tomcat to resolve the issue for short-time. >>>>>> Also accessing WebServer URL is very very slow than tomcat >>>>>> URL (Mostly it takes 30-45seconds to load a Page). >>>>>> >>>>>> I have added tomcat/Apache configurations below, Kindly >>>>>> please help me to resolve this issue. >>>>>> >>>>>> >>>>>> Tomcat (Server.xml): >>>>> >>>>>> protocol="HTTP/1.1" >>>>> >>>>> connectionTimeout="600000" >>>>>> redirectPort="8443" URIEncoding="UTF-8" >>>>>> emptySessionPath="true"/> >>>>>> >>>>>> >>>>> >>>> >>>>>> URIEncoding="UTF-8" connectionTimeout="600000"/> <------ >>>>>> (*) >>>>>> >>>>>> >>>>>> Apache (Workers.properties): worker.list=prod_live_svr >>>>>> worker.prod_live_svr.type=ajp13 >>>>>> >>>>>> worker.prod_live_svr.host=10.100.0.31 >>>>>> worker.prod_live_svr.port=9009 >>>>>> worker.prod_live_svr.lbfactor=50 >>>>>> worker.prod_live_svr.socket_keepalive=1 >>>>>> >>>>>> worker.prod_live_svr.connection_pool_size=100 >>>>>> worker.prod_live_svr.connection_pool_minsize=50 >>>>>> worker.prod_live_svr.connection_pool_timeout=500 >>>>>> >>>>>> >>>>>> VirtualHost.conf: >>>>>> >>>>>> ServerName 10.100.0.31 >>>>>> >>>>>> >>>>>> ErrorLog logs/live/http_error.log RewriteLog >>>>>> logs/live/http_rewrite.log >>>>>> >>>>>> RewriteEngine on RewriteCond %{REMOTE_ADDR} >>>>>> !^10\.100\.0\.31$ RewriteRule ^/+$ /sites/ [R,L] >>>>>> >>>>>> Options +FollowSymlinks >>>>>> RewriteEngine On >>>>>> >>>>>> RewriteOptions Inherit RewriteLog logs/rewrite.log >>>>>> >>>>>> JkMount /* prod_live_svr >>>>>> >>>>>> JkOptions +ForwardURICompatUnparsed >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> 1) Question : are Apache httpd and Tomcat on the same machine >>>>>> ? >>>>> >>>>> And if yes, why do you not set >>>>> >>>>> worker.prod_live_svr.host=127.0.0.1 >>>>> >>>>>> >>>>>> >>>>> 2) why : connectionTimeout="600000" (*) That is 5 minutes. By >>>>> default, "keepAliveTimeout" is also that same value. It means >>>>> that after a request is processed (and finished) on one >>>>> instance of a Connector, this Connector will remain "stuck" on >>>>> the same connection for another 5 minutes, before it gives up >>>>> and closes it. That is kind of wasteful. >>>>> >>>>> 3) Why this : worker.prod_live_svr.socket_keepalive=1 Do you >>>>> have a firewall between Apache httpd and Tomcat ? >>>>> >>>>> 4) Why these ? >>>>> >>>>> worker.prod_live_svr.connection_pool_size=100 >>>>>> worker.prod_live_svr.connection_pool_minsize=50 >>>>>> worker.prod_live_svr.connection_pool_timeout=500 >>>>>> >>>>>> >>>>> See : >>>>> http://tomcat.apache.org/connectors-doc/reference/workers.html >>>>> --> connection_pool_size --> connection_pool_minsize --> >>>>> connection_pool_timeout (see also (*) above) >>>>> >>>>> In general (and particularly since you do not seem to be an >>>>> expert in this kind of configuration), you should not set >>>>> parameters when you do not understand exactly what they are >>>>> doing. The default configurations of Apache httpd, Tomcat and >>>>> AJP are set by experts (who know what they are doing), to >>>>> values which fit a wide range of realistic use cases. >>>>> >>>>> I would suggest to rewrite your configuration as follows : >>>>> >>>>> I) Tomcat server.xml : >>>>> >>>>> >>>> URIEncoding="UTF-8"> >>>>> >>>>> II) Apache httpd, workers.properties : >>>>> >>>>> worker.list=prod_live_svr >>>>> >>>>> worker.prod_live_svr.type=ajp13 >>>>> worker.prod_live_svr.host=127.0.0.1 >>>>> worker.prod_live_svr.port=9009 >>>>> >>>>> ----------------- >>>>> >>>>> That's it, no other parameters. >>>>> >>>>> The Apache-side mod_jk connector module will by default and >>>>> reasonably set the connection pool size, keepalive and timeout >>>>> values etc. > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org