• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

Tomcat - Run on Solaris Dual Processors

Hi Experts,

I am running apache as a web server and tomcat as the web container on a Solaris 9 with Dual Processors.
I noticed that my website only make sure of one processor.
Most of the time, processor 0 is always idle  (100%) and processor 1 is very busyg(idle 0%).
Thus, my web site is very very slow.

I'd like to make full use of Dual Processors. So if any one is busy, I am hoping to off-load to another CPU.
1) Is there any thing that I must configure on tomcat?
2) Or I shall change my jsp&java programming?

Thank you
totoron
0
totoron
Asked:
totoron
  • 4
  • 3
1 Solution
 
arun_kuttzCommented:
here is a neat site on JVM tuning...

http://www.cafesoft.com/products/cams/ps/docs21/admin/PerformanceTuning.html

after reading the above document, i guess one specific tweak u could try is probably allowing the Garbage COllector to run on a separate thread... using the
-XX:+UseParallelGC   option

-KuTtZ



0
 
totoronAuthor Commented:
thanks
i'm using jk connector (mod_jk-apache-2.0.55.so).
any recommendation for the fine tuning configuration?
0
 
ss_pCommented:
to improve the performance of tomcat, Use a Thread Pool in your Connectors.

If you are using Tomcat 3.2 and above.

you can increase the performance of tomcat by changing the default setting for example


Pooled ajpv12 Connector


        <!-- A pooled AJPV12 Connector for out-of-process operation -->
        <Connector
className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter
                name="handler"
               
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter
                name="port"
                value="8007"/>
        </Connector>
               

Can be changed as

        <!-- A pooled AJPV12 Connector for out-of-process operation -->
        <Connector
className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter
                name="handler"
               
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter
                name="port"
                value="8007"/>
            <Parameter
                name="max_threads"
                value="30"/>
            <Parameter
                name="max_spare_threads"
                value="20"/>
            <Parameter
                name="min_spare_threads"
                value="5" />
        </Connector>
               


As can be seen the pool has 3 configuration parameters:

max_threads - defines the upper bound to the for the concurrency, the
pool will not create more then this number of threads.
max_spare_threads - defines the maximum number of threads that the pool
will keep idle. If the number of idle threads passes the value of
max_spare_threads the pool will kill these threads.
min_spare_threads - the pool will try to make sure that at any time
there is at least this number of idle threads waiting for new requests
to arrive. min_spare_threads must be bigger then 0.

You should use the above parameters to adjust the pool behavior to your
needs.

i think so this would help in increasing the performance of tomcat


0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
totoronAuthor Commented:
thanks ss_p
so sorry...my mistakes...i'm using mod_jk and not mod_jk2.

i'm thinking of using the load balancer in my worker properties file...
but i've only one machine....load balancer will not work or help, am i right?

0
 
ss_pCommented:
yes you are correct.

but you can improve the performance of the tomcat. I think that it might help you in increase the performance.
0
 
totoronAuthor Commented:
the mod_jk is using ajp13 port 8009.

my tomcat setting is
 <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
               enableLookups="false" redirectPort="8443" debug="0"
               minProcessors="5" maxProcessors="150"
               protocol="AJP/1.3" />

How could i improve this?
0
 
ss_pCommented:
you can change the connector to

<Connector port="8009" className="org.apache.coyote.tomcat4.CoyoteConnector"                  
           enableLookups="false" redirectPort="8443" protocol="AJP/1.3"
           connectionTimeOut="120000" acceptCount="100" maxThreads="30"
           minSpareThreads="5" maxSpareThreads="5"
           useBodyEncodingForURI="true">


The default configuration is suitable for medium load sites with an
average of 10-40 concurrent requests. If your site differs you should
modify this configuration (for example reduce the upper limit) as shown above.

This should increase the tomcat performance.

0
 
ss_pCommented:
Have you got any answers.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now