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 CFF097181 for ; Mon, 10 Oct 2011 19:02:10 +0000 (UTC) Received: (qmail 19062 invoked by uid 500); 10 Oct 2011 19:02:07 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 18909 invoked by uid 500); 10 Oct 2011 19:02:06 -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 18900 invoked by uid 99); 10 Oct 2011 19:02:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 19:02:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pid@pidster.com designates 209.85.215.173 as permitted sender) Received: from [209.85.215.173] (HELO mail-ey0-f173.google.com) (209.85.215.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 19:02:02 +0000 Received: by eyh6 with SMTP id 6so1733362eyh.18 for ; Mon, 10 Oct 2011 12:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pidster.com; s=google; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:openpgp :content-type; bh=YSMJs32X0iCd7zYlSZF2J39vlAeUAm/vSbT9aR4WVF8=; b=eRDJeVmcfWHopZuAIb0ZtULRVWnJ94lxMnd2xoWC9rExq4nw2D8rT8fX3FantdLv8/ AaAFfkxDXoNPTY5fOKSGKYs+0tzyv5mlYuquAupbPqoEHVIV5ACizXKZL4nvxLLy9fPT Hgs1vYO4TmJwcJM+h/YxmRBoBiLCLiZtN5tVw= Received: by 10.213.4.194 with SMTP id 2mr1025097ebs.41.1318273299152; Mon, 10 Oct 2011 12:01:39 -0700 (PDT) Received: from Asura.local ([194.204.15.33]) by mx.google.com with ESMTPS id w58sm31071718eeb.4.2011.10.10.12.01.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Oct 2011 12:01:37 -0700 (PDT) Message-ID: <4E93410A.2070103@pidster.com> Date: Mon, 10 Oct 2011 20:01:30 +0100 From: Pid Organization: Pidster Inc User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: two questions about the session timeout in tomcat References: <4E8F0B69.3040507@christopherschultz.net> In-Reply-To: X-Enigmail-Version: 1.3.2 OpenPGP: id=62590808 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig99711506D9D94447F982691E" --------------enig99711506D9D94447F982691E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/10/2011 09:18, Igor Cicimov wrote: > Is there anything in the log files? Do you have enough threads in the t= hread > pool? I would also ask the DBA's to give me the list of the longest run= ning > queries. +1 "the server is slow" doesn't really mean much, without more detail. What is slow, the application, the database or something else? Enable JMX[1] & connect VisualVM[2] to your Tomcat instance. p 1. http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling_JMX_Remo= te 2. http://visualvm.java.net/ > On Oct 10, 2011 3:02 PM, "Bill Wang" wrote: >=20 >> Hi Chris, Pid & Geroge, >> >> Thanks to everyone who replied my mail. I try to answer your questions= in >> one mail. >> >> 1. I access the admin interface by manager app. I'd like to have exist= >> command to run and get the report easily, if there is no the command, = I >> will >> think to use wget | crul. >> >> 2. The application with sessions under 60 normally has no issue. But w= hen >> the session go up to 80 ~ 100, I start to get calls from the customer.= It >> happens many times at random time. Sometime I have to restart it, with= out >> any changes, after restart, customer can continuous use it. This >> performance >> issue is very annoying. >> >> 3. From Chris explanation, looks to change the timeout to 30 minutes w= ill >> be >> good idea, since I don't care of the end users to login the system >> more frequently, I need more stable system. The server has other hea= vy >> applications running, CPU load is always up to 10 ~ 20, available phy= sical >> memory is not too much (<10GB). >> >> 4. We are doing the troubleshooting on this application recently and = don't >> find too much can be done. Check with network and DBA team, they all r= eport >> me there is no issue. Contacted with Developers who maintain the tomca= t app >> codes, they said the code running in their testing environment is fine= =2E I >> am >> planned to do some load testing, but it is just in plan. >> >> 5. @ Pid: >> >> Can you explain me more detail on how to do with your suggestion, I am= not >> developer, don't write codes, my role in this project is to setup the >> webserver, tomcat service and make it running and stable. >> >> >> **********************************************************************= ********************* >> The session count per application can be read via a JMX connection and= >> a request to the appropriate MBean. >> >> **********************************************************************= ********************* >> 6. @ Geroge >> >> Sorry, I don't understand your question. We DO have Oracle Database i= n the >> backend. >> >> **********************************************************************= ********************* >> Are you storing objects on the session, in particular JDBC connections= >> or result sets? >> >> **********************************************************************= ********************* >> >> Regards >> Bill >> On Sat, Oct 8, 2011 at 1:23 AM, Christopher Schultz < >> chris@christopherschultz.net> wrote: >> > Bill, >=20 > On 10/6/2011 7:20 PM, Bill Wang wrote: >>>>> Recently one of Tomcat application has performance issue, which get= >>>>> slow respond with high sessions. >=20 > Can you give us some numbers? At what point do things slow down, and > by how much do they slow down? >=20 >>>>> One team member recommend me to adjust the session timeout from 60= >>>>> minutes to 30 minutes. I will do that, but before change it, I'd >>>>> like to understand how the performance related with the expire >>>>> session timeout. >>>>> >>>>> 60 >=20 > I'm not sure performance will change at all when changing the session > timeout. Tomcat runs session-expiration tasks periodically, and the > performance of that has more to do with the number of total sessions > than the timeout itself. >=20 > If you have lots of sessions that must timeout instead of being > explicitly invalidated (i.e. people close their browsers instead of > logging-out), then you will have a lot of wasted memory that may > prevent the garbage collector from working efficiently. It's best to > destroy sessions as soon as they are not needed, so short session > timeouts can help with that. On the other hand, you want to give users > a reasonable amount of time to get a cup of coffee, etc. without > forcing them to re-login every time. >=20 > You'll have to determine what is an appropriate amount of time for > your users. >=20 > There is another option: selectively extend the session timeout for > certain sessions, or for certain operations. If a user enters a flow > that is expected to take a long time or the consequences of having the > session time out are frustrating (i.e. you have to re-enter tons of > data), you can change the session timeout for that one session to be > longer than the default. When the flow is over, you can re-set it back > to the default. We do that for a number of tasks in our webapp, for > instance. >=20 >>>>> Second, currently I monitor the session count by login the admin >>>>> interface, >=20 > Do you mean using the "manager" app? >=20 >>>>> the manual way is not efficiency, can I run some commands to get >>>>> the sessions number? With that I can set a cronjob and generate the= >>>>> session report easily. >=20 > If you have the manager app deployed, you can use the text or XML > interfaces from the command-line instead of the HTML interface. Simple > use of wget, curl, etc. should allow you to do this kind of thing. >=20 > -chris >>> >>> ---------------------------------------------------------------------= >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>> For additional commands, e-mail: users-help@tomcat.apache.org >>> >>> >> >=20 --------------enig99711506D9D94447F982691E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJOk0EOAAoJEGoM2OGpOvr9P3QQAJ9QADfss8XV+EchswIejAEM 0Tu/o9d805gc0hviBipb6ILYfLyrtj9Cuazt9LWTAa6QE6bJcDhr/o41NquuXhap oJSTtv1FkZFqTV7Tph2BK7MuhDz5xMhxnA2/Fe4P4UaqbSaN7kW+xQ8iltfpv5CK DnZ9pD52pSa+N06AmoThelruQ5QGhWh52g5wcTYreSjT5qF8TnC+wXjSXDrYiUMd 6k+mXYPZ2QuDXqdYiyduumwb7jVhw2FX33R9KI8qnkAlGVcbXPSDI/hRrSCe6dS8 hEPtxWUiVh/y66E/wce3DwFCS/oXkAPb4GbvtQkCT8xW3AetHh13upQ5KevxHtrY 26w8r9iHnAN2NhvBHzcYXq4flIsJlx3H/9T25UvHxJtFteguR6OepC8rC5lE/Q3y R0eWFmR5MzLf8b8UrzK1DbeTjo/WT/WewMMsyMoNrQE6IiK7iwVFvYjfy5e8rCzb iKZT4KSgEbit6tSY86fOt18oJGGf1ZWnMv6LwO0ZyfkuE7bEJV6n+itV8pXtBzRL EM6TXFk9zFUVuGdSaNg66hq93yeoxPG/jo67S6zS8Bkh4IxJQw4MEsHjNRuIbB6Z Mf/Eolvv/U0iWgnqC3w2FvfVdd9GjsqZFljRPt8bGbZ+YGOEFksmraMOHpDzV4FO NmT657x+A41PR/j0OpA9 =ZWWA -----END PGP SIGNATURE----- --------------enig99711506D9D94447F982691E--