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 5DCE510DE8 for ; Mon, 10 Jun 2013 15:57:04 +0000 (UTC) Received: (qmail 59166 invoked by uid 500); 10 Jun 2013 15:57:00 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 59052 invoked by uid 500); 10 Jun 2013 15:57:00 -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 58990 invoked by uid 99); 10 Jun 2013 15:56:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 15:56:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 15:56:52 +0000 Received: from [192.168.245.216] (HSI-KBW-37-49-53-194.hsi14.kabel-badenwuerttemberg.de [37.49.53.194]) (Authenticated sender: andre.warnier@ice-sa.com) by tor.combios.es (Postfix) with ESMTPA id EF29C3C2A72 for ; Mon, 10 Jun 2013 17:56:55 +0200 (CEST) Message-ID: <51B5F72E.90605@ice-sa.com> Date: Mon, 10 Jun 2013 17:56:30 +0200 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat: one user per application References: <51B5B492.7080501@rktmb.org> <51B5DF34.4060108@christopherschultz.net> In-Reply-To: <51B5DF34.4060108@christopherschultz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Mihamina, > > On 6/10/13 7:12 AM, Mihamina Rakotomandimby wrote: >> I have one Tomcat instance, which has several applications >> (containers) > > Note: these are not "containers" (at least not in any spec-recognized > way). Tomcat is the container, the webapps are called "contexts" -- or > just webapps usually. > >> On my installation, when Tomcat is running, only "java" process >> owned by "tomcat" is listed. >> >> When the "java" process gets 100% CPU, I would like to be able to >> differentiate which application is it about. > > You can only do this by taking a series of thread-dumps (maybe 1 every > 5 seconds for 15 or 20 seconds) and comparing them to each other. You > can probably find out which threads are doing a lot of work (because > they are running a lot of code over the time period) and which > applications are being used (because of the content of the stack traces). > > Of course, you have to have a way to detect "high" CPU usage (100% > probably isn't good enough) and then trigger these thread dumps, etc. > >> One solution, for me, is to be able to run one java process per >> war under a (pre-created) system user. I would like to keep only >> one Tomcat instance. > > You can have one of these, but not both. You *can* have a single > Tomcat /installation/ and multiple instances, of course (read the > RUNNING.txt file that comes with the Tomcat bundle under the > "Advanced" section). > > Remember: memory is cheap. It's not that costly to run multiple Tomcat > instances. Tomcat requires roughly 12MiB on my system (64-bit with > compressed OOPs) with no web applications deployed into it. > Alternatively, a "cheap" way of getting at least an idea of what application is using a lot of time : In a first approximation, I would tend to believe that an application which uses a lot of CPU time, is also probably slow to respond (to the user). You could enable the Tomcat Access Log, and provide a format which prints to the log, the time needed to process each request. Then by examining the log, it should give you at least some idea of which application is taking such resources. It is a very rough, and may give you false results. But it is also easier and quicker than any other method which I can think of. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org