?
Solved

Tomcat - Run on Solaris Dual Processors

Posted on 2006-05-04
8
Medium Priority
?
368 Views
Last Modified: 2013-12-05
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
Comment
Question by:totoron
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:arun_kuttz
ID: 16604082
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
 

Author Comment

by:totoron
ID: 16612824
thanks
i'm using jk connector (mod_jk-apache-2.0.55.so).
any recommendation for the fine tuning configuration?
0
 
LVL 3

Expert Comment

by:ss_p
ID: 16613698
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:totoron
ID: 16619512
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
 
LVL 3

Expert Comment

by:ss_p
ID: 16622351
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
 

Author Comment

by:totoron
ID: 16627464
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
 
LVL 3

Accepted Solution

by:
ss_p earned 2000 total points
ID: 16629554
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
 
LVL 3

Expert Comment

by:ss_p
ID: 16733635
Have you got any answers.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question