You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "M. Serrano" <sm...@hotmail.com> on 2002/05/02 15:26:51 UTC

mod_jk performance optimization

Hi.

I've got installed in my box Linux, Apache 1.3.19, JDK 1.3.1 and TC 3.3.1 
working with ajp13. The following error appeard in my mod_jk.log after a bit 
of continuous utilisation:

[jk_ajp13_worker.c (203)]: connection_tcp_get_message: Error - 
jk_tcp_socket_recvfull failed
[jk_ajp13_worker.c (621)]: Error reading request

After analysing the server's config files and reading some threads, I 
concluded that the problem might be resolved through a bit of extra 
re-configuration. Although the problem appearence was delayed, it still 
existed.

I wonder if anyone out there could help me with this subject. I'm sending in 
attach some lines of httpd.conf, server.xml and mod_jk.conf

Thanx a lot for your time.
Serrano.

##
## httpd.conf -- Apache HTTP server configuration file
##

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
#
MinSpareServers 5
MaxSpareServers 10

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 8

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 150

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 200

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/ROOT

# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options  indexes  includes  followSymLinks

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>

# Include TOMCAT
Include /usr/local/jakarta-tomcat-3.3.1/conf/auto/mod_jk.conf-local



-----------------  mod_jk.conf-local -----------------


########## Auto generated on Tue Apr 30 11:47:40 WEST 2002##########

<IfModule !mod_jk.c>
  LoadModule jk_module libexec/mod_jk.so
  AddModule     mod_jk.c
</IfModule>

JkWorkersFile "/usr/local/jakarta-tomcat-3.3.1/conf/jk/workers.properties"
JkLogFile "/usr/local/jakarta-tomcat-3.3.1/logs/mod_jk.log"

JkLogLevel error



#################### /WebApplication ####################

# Static files
Alias /WebApplication 
"/usr/local/jakarta-tomcat-3.3.1/webapps/WebApplication"

<Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/WebApplication">
    Options Indexes FollowSymLinks
    DirectoryIndex index.jsp index.html index.htm
</Directory>


# Deny direct access to WEB-INF and META-INF
#
<Location "/WebApplication/WEB-INF/*">
    AllowOverride None
    deny from all
</Location>

<Location "/WebApplication/META-INF/*">
    AllowOverride None
    deny from all
</Location>

JkMount /WebApplication/servlet  ajp13
JkMount /WebApplication/servlet/*  ajp13
JkMount /WebApplication/*.jsp ajp13

#################### / ####################

# Be sure to update DocumentRoot
# to point to: "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT"
<Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT">
    Options Indexes FollowSymLinks
    DirectoryIndex index.jsp index.html index.htm
</Directory>


# Deny direct access to WEB-INF and META-INF
#
<Location "/WEB-INF/*">
    AllowOverride None
    deny from all
</Location>

<Location "/META-INF/*">
    AllowOverride None
    deny from all
</Location>

JkMount /servlet  ajp13
JkMount /servlet/*  ajp13
JkMount /*.jsp ajp13


------ server.xml ------
.
.
.
        <ApacheConfig forwardAll="false" noRoot="false" jkDebug="error"/>
        <IISConfig noRoot="false" />
        <NSConfig noRoot="false" />

  <!-- ==================== Connectors ==================== -->

       <Http10Connector   port="8080"
			   secure="false"
			   maxThreads="200"
			   maxSpareThreads="50"
			   minSpareThreads="10" />

        <Ajp12Connector	 port="8007" />

        <Ajp13Connector port="8009"
                        maxThreads="300"
                        maxSpareThreads="100"
                        minSpareThreads="10" />
.
.
.

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: mod_jk performance optimization

Posted by co...@covalent.net.
On Thu, 2 May 2002, M. Serrano wrote:

> Hi.
> 
> I've got installed in my box Linux, Apache 1.3.19, JDK 1.3.1 and TC 3.3.1 
> working with ajp13. The following error appeard in my mod_jk.log after a bit 
> of continuous utilisation:
> 
> [jk_ajp13_worker.c (203)]: connection_tcp_get_message: Error - 
> jk_tcp_socket_recvfull failed
> [jk_ajp13_worker.c (621)]: Error reading request

>From the line numbers, you may use an older version of jk, try updating 
from CVS head first ( the bug may be already fixed ) ( you can use either
the 'frozen' jk from 3.3 or j-t-c ).

The error message means from some reasons tomcat didn't sent back any 
content - so you may need to look in tomcat's lots as well.

( the 'reading request' means the request from tomcat to jk to send a 
chunk of data ) 

Costin

> 
> After analysing the server's config files and reading some threads, I 
> concluded that the problem might be resolved through a bit of extra 
> re-configuration. Although the problem appearence was delayed, it still 
> existed.
> 
> I wonder if anyone out there could help me with this subject. I'm sending in 
> attach some lines of httpd.conf, server.xml and mod_jk.conf
> 
> Thanx a lot for your time.
> Serrano.
> 
> ##
> ## httpd.conf -- Apache HTTP server configuration file
> ##
> 
> #
> # Timeout: The number of seconds before receives and sends time out.
> #
> Timeout 300
> 
> #
> # KeepAlive: Whether or not to allow persistent connections (more than
> # one request per connection). Set to "Off" to deactivate.
> #
> KeepAlive On
> 
> #
> # MaxKeepAliveRequests: The maximum number of requests to allow
> # during a persistent connection. Set to 0 to allow an unlimited amount.
> # We recommend you leave this number high, for maximum performance.
> #
> MaxKeepAliveRequests 100
> 
> #
> # KeepAliveTimeout: Number of seconds to wait for the next request from the
> # same client on the same connection.
> #
> KeepAliveTimeout 15
> 
> #
> # Server-pool size regulation.  Rather than making you guess how many
> # server processes you need, Apache dynamically adapts to the load it
> # sees --- that is, it tries to maintain enough server processes to
> # handle the current load, plus a few spare servers to handle transient
> # load spikes (e.g., multiple simultaneous requests from a single
> # Netscape browser).
> #
> # It does this by periodically checking how many servers are waiting
> # for a request.  If there are fewer than MinSpareServers, it creates
> # a new spare.  If there are more than MaxSpareServers, some of the
> # spares die off.  The default values are probably OK for most sites.
> #
> MinSpareServers 5
> MaxSpareServers 10
> 
> #
> # Number of servers to start initially --- should be a reasonable ballpark
> # figure.
> #
> StartServers 8
> 
> #
> # Limit on total number of servers running, i.e., limit on the number
> # of clients who can simultaneously connect --- if this limit is ever
> # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
> # It is intended mainly as a brake to keep a runaway server from taking
> # the system with it as it spirals down...
> #
> MaxClients 150
> 
> #
> # MaxRequestsPerChild: the number of requests each child process is
> # allowed to process before the child dies.  The child will exit so
> # as to avoid problems after prolonged use when Apache (and maybe the
> # libraries it uses) leak memory or other resources.  On most systems, this
> # isn't really needed, but a few (such as Solaris) do have notable leaks
> # in the libraries. For these platforms, set to something like 10000
> # or so; a setting of 0 means unlimited.
> #
> # NOTE: This value does not include keepalive requests after the initial
> #       request per connection. For example, if a child process handles
> #       an initial request and 10 subsequent "keptalive" requests, it
> #       would only count as 1 request towards this limit.
> #
> MaxRequestsPerChild 200
> 
> #
> # DocumentRoot: The directory out of which you will serve your
> # documents. By default, all requests are taken from this directory, but
> # symbolic links and aliases may be used to point to other locations.
> #
> DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/ROOT
> 
> # This should be changed to whatever you set DocumentRoot to.
> #
> <Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT">
> 
> #
> # This may also be "None", "All", or any combination of "Indexes",
> # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
> Options  indexes  includes  followSymLinks
> 
> #
> # This controls which options the .htaccess files in directories can
> # override. Can also be "All", or any combination of "Options", "FileInfo",
> # "AuthConfig", and "Limit"
> #
> AllowOverride None
> 
> #
> # Controls who can get stuff from this server.
> #
> Order allow,deny
> Allow from all
> </Directory>
> 
> # Include TOMCAT
> Include /usr/local/jakarta-tomcat-3.3.1/conf/auto/mod_jk.conf-local
> 
> 
> 
> -----------------  mod_jk.conf-local -----------------
> 
> 
> ########## Auto generated on Tue Apr 30 11:47:40 WEST 2002##########
> 
> <IfModule !mod_jk.c>
>   LoadModule jk_module libexec/mod_jk.so
>   AddModule     mod_jk.c
> </IfModule>
> 
> JkWorkersFile "/usr/local/jakarta-tomcat-3.3.1/conf/jk/workers.properties"
> JkLogFile "/usr/local/jakarta-tomcat-3.3.1/logs/mod_jk.log"
> 
> JkLogLevel error
> 
> 
> 
> #################### /WebApplication ####################
> 
> # Static files
> Alias /WebApplication 
> "/usr/local/jakarta-tomcat-3.3.1/webapps/WebApplication"
> 
> <Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/WebApplication">
>     Options Indexes FollowSymLinks
>     DirectoryIndex index.jsp index.html index.htm
> </Directory>
> 
> 
> # Deny direct access to WEB-INF and META-INF
> #
> <Location "/WebApplication/WEB-INF/*">
>     AllowOverride None
>     deny from all
> </Location>
> 
> <Location "/WebApplication/META-INF/*">
>     AllowOverride None
>     deny from all
> </Location>
> 
> JkMount /WebApplication/servlet  ajp13
> JkMount /WebApplication/servlet/*  ajp13
> JkMount /WebApplication/*.jsp ajp13
> 
> #################### / ####################
> 
> # Be sure to update DocumentRoot
> # to point to: "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT"
> <Directory "/usr/local/jakarta-tomcat-3.3.1/webapps/ROOT">
>     Options Indexes FollowSymLinks
>     DirectoryIndex index.jsp index.html index.htm
> </Directory>
> 
> 
> # Deny direct access to WEB-INF and META-INF
> #
> <Location "/WEB-INF/*">
>     AllowOverride None
>     deny from all
> </Location>
> 
> <Location "/META-INF/*">
>     AllowOverride None
>     deny from all
> </Location>
> 
> JkMount /servlet  ajp13
> JkMount /servlet/*  ajp13
> JkMount /*.jsp ajp13
> 
> 
> ------ server.xml ------
> .
> .
> .
>         <ApacheConfig forwardAll="false" noRoot="false" jkDebug="error"/>
>         <IISConfig noRoot="false" />
>         <NSConfig noRoot="false" />
> 
>   <!-- ==================== Connectors ==================== -->
> 
>        <Http10Connector   port="8080"
> 			   secure="false"
> 			   maxThreads="200"
> 			   maxSpareThreads="50"
> 			   minSpareThreads="10" />
> 
>         <Ajp12Connector	 port="8007" />
> 
>         <Ajp13Connector port="8009"
>                         maxThreads="300"
>                         maxSpareThreads="100"
>                         minSpareThreads="10" />
> .
> .
> .
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>