You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by je...@escalate.com on 2002/08/21 23:12:22 UTC

Weird CPU profile during tomcat 3.3.1 performance test

Hello,

I am seeing some very wired CPU profile while running a small stress test
with tomcat 3.3.1 and apache 2.0.39 on a 2 CPU Solaris box. 

While running the test, I don't get an even load on the two CPUs as shown in
the mpstat log below. This profile looks like a single threaded process so I
have been tweaking a few threading parameters to fix this but nothing I have
done seems to get the load even. I attached below the httpd worker and
tomcat ajp13 settings.

Would anybody have an explanation for this behavior and/or suggestions on
how to configure tomcat to spread the load over the CPUs?

cheers,

JP

Here is a capture of mpstat that shows a big load discrepancy between the
two CPUs.

CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  1   89   0  284   835  601 1588  621   42  150    0  2460   94   5   0   1
  2   59   0  134   283  100 1514  384   39  182    0  2332   17  12   9  62
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  1  213   0  445   704  437 2429  990   65  133    0  3511   71   9   0  20
  2  237   0  376   403  100 1396  397   62  152    0  2083   42  10   1  48
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  1   54   0  171   493  340  517  210   20   55    0  1155   96   4   0   0
  2   46   0   53   171  100  940  233   24   53    0  1445    9   2   0  88


Here are some parts of httpd.conf and server.xml:

server.xml

<Ajp13Connector port="11082"
   debug="0"
   maxThreads="200"
   maxSpareThreads="100"
   minSpareThreads="10"
   pools="true"/>

httpd.conf worker:

<IfModule worker.c>
ThreadLimit        64
ServerLimit        16
StartServers        2
MaxClients        500
MinSpareThreads    25
MaxSpareThreads   100
ThreadsPerChild    50
MaxRequestsPerChild 0
</IfModule>


Jean-Philippe Prefot
Escalate Inc.
jp.prefot@escalate.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Weird CPU profile during tomcat 3.3.1 performance test

Posted by Bill Barker <re...@verizon.net>.
<je...@escalate.com> wrote in message
news:130EB5645B7ED611ABE600D0B769298C1F0D46@exch1.sclt.com...
> Hello,
>
> I am seeing some very wired CPU profile while running a small stress test
> with tomcat 3.3.1 and apache 2.0.39 on a 2 CPU Solaris box.
>
> While running the test, I don't get an even load on the two CPUs as shown
in
> the mpstat log below. This profile looks like a single threaded process so
I
> have been tweaking a few threading parameters to fix this but nothing I
have
> done seems to get the load even. I attached below the httpd worker and
> tomcat ajp13 settings.
>
> Would anybody have an explanation for this behavior and/or suggestions on
> how to configure tomcat to spread the load over the CPUs?

I'm assuming that you've checked the obvious things, such as that your JVM
is running native threads, rather than green threads.

It is easily possible that the test itself is skewing the results.  If the
test application is using keep-alive, then requests will get routed to the
same Apache thread and from there to the same Tomcat thread.

If none of this applies, than at the very least, we'll need to know such
details as your JVM version, and which version of mod_jk you are using.

>
> cheers,
>
> JP
>
> Here is a capture of mpstat that shows a big load discrepancy between the
> two CPUs.
>
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt
idl
>   1   89   0  284   835  601 1588  621   42  150    0  2460   94   5   0
1
>   2   59   0  134   283  100 1514  384   39  182    0  2332   17  12   9
62
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt
idl
>   1  213   0  445   704  437 2429  990   65  133    0  3511   71   9   0
20
>   2  237   0  376   403  100 1396  397   62  152    0  2083   42  10   1
48
> CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt
idl
>   1   54   0  171   493  340  517  210   20   55    0  1155   96   4   0
0
>   2   46   0   53   171  100  940  233   24   53    0  1445    9   2   0
88
>
>
> Here are some parts of httpd.conf and server.xml:
>
> server.xml
>
> <Ajp13Connector port="11082"
>    debug="0"
>    maxThreads="200"
>    maxSpareThreads="100"
>    minSpareThreads="10"
>    pools="true"/>
>
> httpd.conf worker:
>
> <IfModule worker.c>
> ThreadLimit        64
> ServerLimit        16
> StartServers        2
> MaxClients        500
> MinSpareThreads    25
> MaxSpareThreads   100
> ThreadsPerChild    50
> MaxRequestsPerChild 0
> </IfModule>
>
>
> Jean-Philippe Prefot
> Escalate Inc.
> jp.prefot@escalate.com





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and connection pooling

Posted by Felipe Schnack <fe...@ritterdosreis.br>.
  If you want to use dbcp send me a mail. I had bad days trying to
configure it, but it's working, I can send you my configuration (using
pgSQL)

On Wed, 2002-08-21 at 19:24, Andrew Conrad wrote:
> You can use JNDI to allow for sharing of connections across servlets
> using either the built in pool (dbcp) or your own pool.
> 
> 
> For Tomcat 4.0.x, you can look here (about half way down)
> 
> http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.htm
> l
> 
> 
> - Andrew
> 
> > -----Original Message-----
> > From: Ashish Kulkarni [mailto:kulkarni_ash13@yahoo.com] 
> > Sent: Wednesday, August 21, 2002 5:22 PM
> > To: Tomcat Users List
> > Subject: Tomcat and connection pooling
> > 
> > 
> > Hi,
> > I am using tomcat 4.0.4 and developing a web
> > application for as400 database, now IBM has provided
> > with a set of libraries to connect with AS400
> > database, there is a class called
> > AS400JDBCConnectionPool which creates a connection
> > pool, there are methods to get the connection and
> > return the connection back to pool
> > So the question is, if i create say 30 connections and
> > keep them in the pool in a servlet which is called
> > when i start the application, 
> > how can i get access to this pool (handle of the
> > object created in the first servlet) in other servlets
> > running in the application..
> > I dont want to keep it in session, or should i keep
> > the scope of the object at application level??
> > is there any connection pooling example available
> > Ashish
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > For 
> > additional commands, 
> > e-mail: <ma...@jakarta.apache.org>
> > 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and connection pooling

Posted by Andrew Conrad <an...@attbi.com>.
You can use JNDI to allow for sharing of connections across servlets
using either the built in pool (dbcp) or your own pool.


For Tomcat 4.0.x, you can look here (about half way down)

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.htm
l


- Andrew

> -----Original Message-----
> From: Ashish Kulkarni [mailto:kulkarni_ash13@yahoo.com] 
> Sent: Wednesday, August 21, 2002 5:22 PM
> To: Tomcat Users List
> Subject: Tomcat and connection pooling
> 
> 
> Hi,
> I am using tomcat 4.0.4 and developing a web
> application for as400 database, now IBM has provided
> with a set of libraries to connect with AS400
> database, there is a class called
> AS400JDBCConnectionPool which creates a connection
> pool, there are methods to get the connection and
> return the connection back to pool
> So the question is, if i create say 30 connections and
> keep them in the pool in a servlet which is called
> when i start the application, 
> how can i get access to this pool (handle of the
> object created in the first servlet) in other servlets
> running in the application..
> I dont want to keep it in session, or should i keep
> the scope of the object at application level??
> is there any connection pooling example available
> Ashish
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and connection pooling

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 21 Aug 2002, neal wrote:

> Date: Wed, 21 Aug 2002 14:35:43 -0700
> From: neal <ne...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: RE: Tomcat and connection pooling
>
> I see you guys are talking about connection pooling in Tomcat.  I presume
> you must be referring to HTTP connection pooling or something?  Is there a
> dB connection pooling resource in Tomcat? Something like Poolman?
>
> I know this is somewhat off topic but your thread reminded me to ask.
>

Depending on which version you're talking about:

 http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html

 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html

> Thanks.
> Neal
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and connection pooling

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi
Does that mean i can create an Instance of
AS400JDBCConnectionPool class and keep it is servlet
context and then all the servlets can have access to
it??

Ashish
--- neal <ne...@yahoo.com> wrote:
> I see you guys are talking about connection pooling
> in Tomcat.  I presume
> you must be referring to HTTP connection pooling or
> something?  Is there a
> dB connection pooling resource in Tomcat? Something
> like Poolman?
> 
> I know this is somewhat off topic but your thread
> reminded me to ask.
> 
> Thanks.
> Neal
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and connection pooling

Posted by neal <ne...@yahoo.com>.
I see you guys are talking about connection pooling in Tomcat.  I presume
you must be referring to HTTP connection pooling or something?  Is there a
dB connection pooling resource in Tomcat? Something like Poolman?

I know this is somewhat off topic but your thread reminded me to ask.

Thanks.
Neal


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat and connection pooling

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,
I am using tomcat 4.0.4 and developing a web
application for as400 database, now IBM has provided
with a set of libraries to connect with AS400
database, there is a class called
AS400JDBCConnectionPool which creates a connection
pool, there are methods to get the connection and
return the connection back to pool
So the question is, if i create say 30 connections and
keep them in the pool in a servlet which is called
when i start the application, 
how can i get access to this pool (handle of the
object created in the first servlet) in other servlets
running in the application..
I dont want to keep it in session, or should i keep
the scope of the object at application level??
is there any connection pooling example available
Ashish

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>