Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 550 invoked from network); 5 May 2008 00:33:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 May 2008 00:33:27 -0000 Received: (qmail 74071 invoked by uid 500); 5 May 2008 00:33:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 74044 invoked by uid 500); 5 May 2008 00:33:16 -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 74033 invoked by uid 99); 5 May 2008 00:33:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 May 2008 17:33:16 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [206.162.180.58] (HELO sqexc02.korem.com) (206.162.180.58) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2008 00:32:31 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6619.12 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Tomcat problem on a multiple CPU system Date: Sun, 4 May 2008 20:31:47 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Tomcat problem on a multiple CPU system Thread-Index: AciuLlFP16Y+EdYfS+OiieeGjkmYrAAFpyHwAABSYYA= References: <481E2B72.5060102@compulsivecreative.com> From: "Gilbert, Antoine" To: "Tomcat Users List" X-Virus-Checked: Checked by ClamAV on apache.org My english is not very good, I'll try to explain again For example, my test outside of Tomcat for(int i=3D0;i<8;i++){ Thread t =3D new Thread(new Runner()); t.setDaemon(true); t.start(); if(i=3D=3D7) t.join(); } My Runner class do some image rendering test... If I run this directly using Java.exe all is fine, 100% of the 8 CPU are used and it run fast.. If I create a JSP and put the Runner code in it, I open 8 browser windows to launch 8 process via Tomcat, it run slow and it's using like 30% of all CPU... My rendering process read a small geometry file on disk and render it in an Image Buffer, it's not IO intense, just pure CPU processing, no database connection, no network usage, and anyway, whatever this process do, I can run 8 of them using Java.exe and make them using the 8 CPU, but with Tomcat this is not working very well... Antoine -----Original Message----- From: Gilbert, Antoine=20 Sent: 4 mai 2008 20:20 To: Tomcat Users List Subject: RE: Tomcat problem on a multiple CPU system Well, each process is a image rendering process. But my point is, if I launch 8 threads directly in a JVM outside of tomcat, it run faster and use 100% of the 8 CPU... If I make a Servlet (or a JSP) who will start a process each time I call it (I call it 8 times).=20 So, the big question is, why It's fast directly on the JVM and it's slow on Tomcat ? Why with Tomcat It's not possible to use 100% of all the 8 CPU ? There is no data transfer between client and server, in both case the images are rendered on the disk. I just made this rendering test to expose the fact that I'm unable to make my tomcat use efficiently all my CPU. So the big question, why these 8 processes run betters than these 8 process within Tomcat ? -----Original Message----- From: Alan Chaney [mailto:alan@compulsivecreative.com]=20 Sent: 4 mai 2008 17:33 To: Tomcat Users List Subject: Re: Tomcat problem on a multiple CPU system Hi Antoine The thing to remember is that this is a system which has (at least) four main parts: 1. Tomcat 2. The operating system 3. A network connection 4. Your application (and potentially) 5. A database (but you didn't mention that) Here are some questions. 1. How do you make the connection to the servlet. Does the browser run=20 on the same machine as the application? 2. Does you application create network traffic? If so, how many bytes=20 are transferred to the browser? Each servlet thread will have to wait=20 until the application has transferred all the data out. 3. What kind of disk activity does your application generate? Is it=20 different when the app is running from the servlet? Probably somewhere your servlet threads are sleeping waiting for a=20 resource. You could do a thread dump to see what is happening (I don't=20 use Windows so I can't remember how you do that with the Win setup) In the end, you'll need to profile the system to work out where the=20 bottlenecks are. You'll need to use network analysers and probably Java=20 profilers to track down what's happening such as when packets are=20 received, when the replies are generated and maybe profile what your=20 app. is doing. HTH Alan Chaney Gilbert, Antoine wrote: > Hi >=20 > =20 >=20 > I have a 2x quad core (8 cpu units) server. >=20 > =20 >=20 > If I start a java program and this one is launching (at the same time) 8 > thread doing some CPU intensive jobs, all the CPU are used at 100%, and > that's what I'm expecting.. >=20 > =20 >=20 > But, if I am using tomcat, and I call a servlet 8 times to process these > 8 jobs, it take longer to execute these same 8 jobs and all the CPU are > not used at 100%, it's more like 30%... >=20 > =20 >=20 > Any idea about this problem or behavior ? I'm using Tomcat 5.5.17, > windows, JDK 1.6 >=20 > =20 >=20 > Antoine >=20 >=20 >=20 > !DSPAM:481e1bf27941527717022! >=20 --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org