Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61D4510E5C for ; Tue, 11 Feb 2014 00:23:07 +0000 (UTC) Received: (qmail 36398 invoked by uid 500); 11 Feb 2014 00:23:03 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 36332 invoked by uid 500); 11 Feb 2014 00:23:03 -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 36323 invoked by uid 99); 11 Feb 2014 00:23:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Feb 2014 00:23:03 +0000 X-ASF-Spam-Status: No, hits=2.1 required=5.0 tests=HK_RANDOM_ENVFROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kumarkmmca@gmail.com designates 209.85.216.49 as permitted sender) Received: from [209.85.216.49] (HELO mail-qa0-f49.google.com) (209.85.216.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Feb 2014 00:22:56 +0000 Received: by mail-qa0-f49.google.com with SMTP id w8so10571172qac.22 for ; Mon, 10 Feb 2014 16:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ghwxDk4YQo26pw1peIDddk2zFsRs2BPWOr9jE1OyQvA=; b=mRTGuw4OYuwZVq7WmjkF4cdxvsQUlBioX1IrV9LH8OXZp+LNDfjJYAJP/6CUBiZwQ9 ttJFIutMhLUhQzZJI6u2V0HOiiW694BxpB0xwD/fF+72HU+CHmmAermpA0ZHTpe2xTbG smJoaPhO9FuqRHCSl2pieLzhO8RiX67+DcsDouXaeUqDZTMhQRi05WNqVqsSA1FIpLd8 xfr7H5nqjCTBUSUKZFvbul1JMZk/0NRPF/9641i125iheVsh9DrR1fG2UPvevjRAuTDI 0qdn79PoYL3o1LFTroAVe5UCSIQjmbhkzpNlQuarG/QYxk6b3rGy3WnT33yvh2LctCNj xwMA== MIME-Version: 1.0 X-Received: by 10.140.101.104 with SMTP id t95mr49560481qge.106.1392078156078; Mon, 10 Feb 2014 16:22:36 -0800 (PST) Received: by 10.140.28.161 with HTTP; Mon, 10 Feb 2014 16:22:36 -0800 (PST) In-Reply-To: <8175F68C-E9CC-4CC3-9F61-9C18B6D8B21C@gopivotal.com> References: <52F8FE1D.50008@christopherschultz.net> <13C3CD27-78E8-4B8A-B249-63477CCCF577@gopivotal.com> <09DE390D-0EF9-495B-B2DA-C14B89C6D778@gopivotal.com> <8175F68C-E9CC-4CC3-9F61-9C18B6D8B21C@gopivotal.com> Date: Mon, 10 Feb 2014 19:22:36 -0500 Message-ID: Subject: Re: sudden increase in tomcat sessions..? From: Kumar Muthuramalingam To: Tomcat Users List Content-Type: multipart/alternative; boundary=001a11c16f5efe252504f216733b X-Virus-Checked: Checked by ClamAV on apache.org --001a11c16f5efe252504f216733b Content-Type: text/plain; charset=ISO-8859-1 Before that can you tell me one thing please. Suppose if a page request (eg. /UpdateQuery.JSP) is coming from a load balancer to tomcat and the UpdateQuery.JSP is connected to some third party server. Assume if the tomcat is not getting any reply from the Query server for some seconds. Will the load balancer will send ping requests to tomcat to verify the connection of the application ? Thanks Kumar. On Mon, Feb 10, 2014 at 4:21 PM, Daniel Mikusa wrote: > On Feb 10, 2014, at 4:07 PM, Kumar Muthuramalingam > wrote: > > > Yes its the load balancer. and recently I found in the log that there > was a > > memory leak exception while the tomcat server was restarted.The session > > increase problem started from this particular date . Could this be a > cause > > for the tomcat to hang up and DOS occurred? > > Can you include the message you saw? Otherwise it's tough to say. > > > One more question. I see this memory leak exception in only one tomcat > > catalina log file. I didn't see this in other servers log file. One > tomcat > > can handle 200 sessions. So once if it reaches the limit will the > requests > > will get diverted to other available servers so that the server sessions > > also will increase? If so how to find that redirection in log file. > > You'd want to look at how your load balancer is setup. Tomcat just > handles the requests that you send to it. If you want to control how > requests are delivered to multiple Tomcat servers then you need to do that > before the requests hit your Tomcat servers, like with your load balancer. > > Dan > > > > > Sorry if I 'm crazy. > > > > Thanks, > > Kumar > > > > > > On Mon, Feb 10, 2014 at 2:19 PM, Daniel Mikusa >wrote: > > > >> On Feb 10, 2014, at 1:59 PM, Kumar Muthuramalingam < > kumarkmmca@gmail.com> > >> wrote: > >> > >>> Thanks for the reply. I accept this remedy will clear the issue. But my > >>> question is how to verify the root cause of this DOS attack that > occurred > >>> earlier? > >> > >> As previously directed, look at your access logs. That should show you > >> who is requesting this JSP file. > >> > >> If it's your load balancer (or some other trusted IP), then problem > >> solved. Just correct the JSP. > >> > >> If it's a third party then in additional to fixing the JSP, you'll > >> probably want to investigate why they're calling that JSP so much. I > >> suppose you could even go so far as to blocking them with your firewall > or > >> a filter, but that's up to you. > >> > >> Dan > >> > >>> What ever steps suggested above is to take a precaution or solve > >>> the issue. please help me. > >>> > >>> Thanks, > >>> Kumar. > >>> > >>> > >>> On Mon, Feb 10, 2014 at 12:06 PM, Daniel Mikusa >>> wrote: > >>> > >>>> On Feb 10, 2014, at 11:56 AM, Kumar Muthuramalingam < > >> kumarkmmca@gmail.com> > >>>> wrote: > >>>> > >>>>> Thanks for your reply. I have 3 applications running under the tomcat > >> and > >>>>> only one application got a ping.jsp file others don't. And also I > could > >>>> see > >>>>> from the access logs that only the application that has got ping.jsp > >> file > >>>>> was pinged others were not. And the sessions are high only for this > >>>>> particular application. Now I got something else in my mind. Is > >> ping.jsp > >>>> is > >>>>> a mandatory file for tomcat. We got nothing in that ping.jsp. It 's > an > >>>>> empty file with <%="OK"%>. > >>>> > >>>> Seems like this could be the problem. This JSP file is going to > create > >> a > >>>> session every time you "ping" it, since JSP files will create a > session > >> by > >>>> default. If you're client, whatever is requesting this JSP, doesn't > >>>> maintain the session then it'll end up creating a new session every > >> time it > >>>> requests the JSP page. > >>>> > >>>> Add this and the JSP won't create a session. > >>>> > >>>> <%@ page session="false" %> > >>>> > >>>>> I agree this could be due to DOS attack. > >>>> > >>>> If so, it would seem to be self inflicted. Fix your JSP file and I > bet > >>>> this problem will go away. > >>>> > >>>> Dan > >>>> > >>>>> Can we ask our network pupil to > >>>>> find if there was a network failure or delay happened. Can we find > that > >>>> is > >>>>> my another question? > >>>>> > >>>>> Please help me. > >>>>> > >>>>> Thanks, > >>>>> Kumar. > >>>>> > >>>>> > >>>>> On Mon, Feb 10, 2014 at 11:28 AM, Christopher Schultz < > >>>>> chris@christopherschultz.net> wrote: > >>>>> > >>>>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>>>> Hash: SHA256 > >>>>>> > >>>>>> Kumar, > >>>>>> > >>>>>> On 2/8/14, 7:08 PM, Kumar Muthuramalingam wrote: > >>>>>>> I 'm using tomcat version 6 and 7. One day there was a sudden > >>>>>>> increase in number of sessions in both tomcats. And all the > >>>>>>> sessions had no username, same lastaccessed time, same created time > >>>>>>> and the inactive time was 00:00:00. It is not happening always but > >>>>>>> it happens some times on some day. Can't predict. And We have set > >>>>>>> the idle timeout as -1 because we have to. > >>>>>> > >>>>>> I have a suggestion for this: don't set the session timeout to -1 > >>>>>> until the user has successfully authenticated. > >>>>>> > >>>>>> Sessions can be created at any time, including before > authentication. > >>>>>> You could add a Filter that detects sessions that are authenticated > >>>>>> without the -1 timeout and sets them to that value. > >>>>>> > >>>>>> This would allow login-less sessions to expire naturally while > >>>>>> authenticated users would enjoy sessions that never expire. > >>>>>> > >>>>>> (Honestly, sessions that never expire is probably a bad idea... > >>>>>> clients are disappear at any time and never come back. At least set > >>>>>> the session timeout to something hugely long like 5 days or > something) > >>>>>> > >>>>>>> When I try to dig the log. It showed that the load balancer IP was > >>>>>>> sending many ping requests to our application. Can anybody tell why > >>>>>>> this is happening and how can I find the cause? > >>>>>> > >>>>>> The lb needs to ping your webapp all the time to see if it's up. > >>>>>> Perhaps it's using a resource that (stupidly) always creates a > session > >>>>>> if one does not exist? > >>>>>> > >>>>>> - -chris > >>>>>> -----BEGIN PGP SIGNATURE----- > >>>>>> Version: GnuPG v1 > >>>>>> Comment: GPGTools - http://gpgtools.org > >>>>>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > >>>>>> > >>>>>> iQIcBAEBCAAGBQJS+P4dAAoJEBzwKT+lPKRYmHUP/1JzT1aYbqq3CWq8bzJsEKtX > >>>>>> LTiNknxXUBmhQE1WZ5J+4f2Pq/7spUD0rOGtkvYyuGw37+ruL0AGJSiEzQ2uA6mD > >>>>>> rtylt5IzGO4jjW2Yqr4LlDKmXhBr0IDj4+Xz1KT4W7R7XDY6gNIfN1d8CuAAAP0F > >>>>>> BKSLj3crNEmDur+hd0SH3m+oNKYpgy/xVfvWN2MohBY4rIAPpGvmS9IJDeKaWyHY > >>>>>> +SZYsyN6bKExWCqaQbObL7ZjHwLhC+hLECEDHFNiZje5dCyKMaALVJYNkaB/jzWw > >>>>>> ZLv3FNyTpG35hhBM1j760C+37ZkRt34+rER7ZBBEODfgoxQSGb59Fe9uCtX8aVa4 > >>>>>> 9ATxQ8RAqJcMaCgJ6ADTiJhf91MGbPtWJ5ABwqzg8iP650gUcF6RiRWPFdpq1k33 > >>>>>> 6SCGeEwHoIMuzCvnp1EiaxXaDFQ1NUYhCz5fEkAeYmZlgl/SlTHrvhe5lTyMQ179 > >>>>>> CeccAWjrO1UhyJz5bS9pt8l5xzsVAFxlVCk67rLwffAhWxZb6EmrsclTlBaxDyFL > >>>>>> jx6+UH7SADWi0xaGk3LdBdCWHaJRT5F9StPsAReUP/mPpJVVWR6u9x/V1i4HrZX6 > >>>>>> /06jj3RCUBxGPKMk6OlidZDQj9XcKMR1CuDeq+ItfzXKg8rgj3C5FaZXUsNYCNTV > >>>>>> LgJmIZUtom+YKPoikzQB > >>>>>> =2HLh > >>>>>> -----END PGP SIGNATURE----- > >>>>>> > >>>>>> > --------------------------------------------------------------------- > >>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >>>>>> For additional commands, e-mail: users-help@tomcat.apache.org > >>>>>> > >>>>>> > >>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >>>> For additional commands, e-mail: users-help@tomcat.apache.org > >>>> > >>>> > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >> For additional commands, e-mail: users-help@tomcat.apache.org > >> > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --001a11c16f5efe252504f216733b--