On 18.05.2009 20:03, Chetan Chheda wrote:
> HTTPd.conf : 
> Timeout 300
> KeepAlive On
> MaxKeepAliveRequests 100
> KeepAliveTimeout 30

HTTP Keep-Alive is nice to achieve lower latency, but it will drive up
the number of httpd threads you need. 100 requests and 20 seconds is for
most use cases to expensive (in terms of needed threads), I would
suggest a KeepAliveTimeout closer to e.g. 5 seconds.

> <IfModule worker.c>
> ThreadLimit        512
> StartServers       100 
> MaxClients         512 
> MinSpareThreads    129 
> MaxSpareThreads    256 
> ThreadsPerChild    256 
> MaxRequestsPerChild  0
> </IfModule>

Apache scales via processes. You chose to size the number of thread per
process to a much higher value than default. That means whenever Apache
starts an additional process, you add a lot of additional threads at
once. That's not a very fine granular scaling. Furthermore the
combination of 100 processes to start with, each with 256 threads, but a
total limit of 512 parallel connections does not make sense. Read
carefully through the httpd documentation what these parameters mean and
how they interact. Also be sure to have anough delta between Min and Max
SpareThrads in terms of multiples of ThreadsPerChild. Otherwise you'll
be very often starting and stopping Apache processes.

>From now on I Assume you find better values, but still go for a maximum
concurrency of 512 http connections.

Which version of mod_jk do you use (strings mod_jk.so | grep 1.2)? Does
HP now provide a recent one? The below attribute names indicate a very
old mod_jk.

Comments below the lines.

> Workers.properties: 
> njipuplmapp01:/opt/hpws/apache/conf#>cat workers.properties
> ps=/

Delete

> workers.tomcat_home=/coach/app/ptc/tomcat1

Delete

> worker.list=ajp13App11,ajp13App12,loadbalancer,mystatus
> worker.ajp13App11.port=8010
> worker.ajp13App11.host=localhost
> worker.ajp13App11.type=ajp13
> worker.ajp13App11.lbfactor=1
> worker.ajp13App11.cache_timeout=900

Read the docs page about timeouts and set your Tomcat connectionTimeout
consistently.

> worker.ajp13App11.socket_timeout=0

I personally don't like the socket_timeout, but much more cping/cpong
timeouts.

> worker.ajp13App11.retries=3
> worker.ajp13App11.recycle_timeout=900
> 
> worker.ajp13App12.port=8011
> worker.ajp13App12.host=localhost
> worker.ajp13App12.type=ajp13
> worker.ajp13App12.lbfactor=1
> worker.ajp13App12.cache_timeout=900
> worker.ajp13App12.socket_timeout=0
> worker.ajp13App12.retries=3
> worker.ajp13App12.recycle_timeout=900
> 
> worker.loadbalancer.type=lb
> worker.loadbalancer.balanced_workers=ajp13App11,ajp13App12
> worker.loadbalancer.method=Request
> worker.loadbalancer.sticky_session=true
> 
> worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
> worker.inprocess.cmd_line=start
> worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
> worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

Delete those three attributes.

> worker.mystatus.type=status
> worker.mystatus.mount=/admin/status/jk
> 
> mod_jk 
> # Configure mod_jk for basic operation
> <IfModule mod_jk.c>
>   JkWorkersFile conf/workers.properties
>   JkLogFile logs/mod_jk.log
>   JkLogLevel info
>   JkShmFile logs/JkShmFile.log
>   
>   # Must use this for proper % escaping (cannot use with Tomcat 3.2.x)
>   JkOptions +ForwardURIEscaped
>   # Uncomment the line below once HP builds with mod_jk 1.2.13 or
>   # higher to ensure that the 'X-Do-not-compress-this' header
>   # behaves as expected.
>   #JkOptions +FlushPackets
>   
>   # Mount all JSP pages with our default worker
>   JkMount /*.jsp loadbalancer
>   JkMount /*.jsp/* loadbalancer
> </IfModule>
> 
> Connector :
>     <Connector acceptCount="100" connectionTimeout="20000" 
> disableUploadTimeout="true" port="8082" redirectPort="8445" 
> maxSpareThreads="75" maxThreads="150" minSpareThreads="25">
>     </Connector>
>     <Connector URIEncoding="UTF-8" acceptCount="100" debug="1" port="8012" 
> protocol="AJP/1.3" 
> protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" 
> redirectPort="8445" tomcatAuthentication="false" useBodyEncodingForURI="true">

Set number of threads (you'll need a maximum of 512, if your web servers
are allowed with 512 connections forwarding to Tomcat)
and also connectionTimeout!

>     </Connector>

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to