tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Munirathinavel <munirathina...@gmail.com>
Subject Configure Apache & Tomcat for atleast 50 concurrent users
Date Wed, 07 Apr 2010 14:21:18 GMT

Hi,
  Our application is a online vehicle rental.We are Apache2.2 as a front end
server & Tomcat 6.0.18 as back-end server with mod_jk2.28 tomcat connector.

The followings are our system configurations,

 1)Operating System - Windows server2008
 2)Processor - Intel Xenon
 3)RAM -4 GB

 I've been doing the load testing our application for couple of months.From
this,I observed our application is not supporting for more than 20
concurrent users.If I put a load for 20 users after a period of time some
pages are not loading.Only i'm seeing the empty window.

I'm not getting anything in tomcat log.
In apache mod_jk.log I'm getting the following error....

[Tue Apr 06 18:12:08 2010][1624:3032] [info] jk_ajp_common.c (1788): Writing
to client aborted or client network problems
[Tue Apr 06 18:12:08 2010][1624:3032] [info] jk_ajp_common.c (2447):
(worker1) sending request to tomcat failed (unrecoverable), because of
client write error (attempt=1)
[Tue Apr 06 18:12:08 2010]worker1 empower.mybiz24by7.com 4.547560
[Tue Apr 06 18:12:08 2010][1624:3032] [info] mod_jk.c (2608): Aborting
connection for worker=worker1

I'm also giving the latest configuration files that i have....

Tomcat Configuration files:
server.xml:

<Server port="8006" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
          <Connector  port="8009" protocol="AJP/1.3" debug="0"
enableLookups="false"
          emptySessionPath="true" redirectPort="8443" maxThreads="512"
          minSpareThreads="50" maxSpareThreads="150" backlog="50"
connectionTimeout="60000" />
    <Engine name="Catalina" defaultHost="****************">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
      <Host name="empower.mybiz24by7.com"  appBase="gateway"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

                        <Listener className =
"org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
      </Host>

          <Host name="account.mybiz24by7.com"  appBase="mybizadmin"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       
                        <Listener className =
"org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
      </Host>

          <Host name="support.mybiz24by7.com"  appBase="mybizsupport"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       
                        <Listener className =
"org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
      </Host>

          <Host name="crm.mybiz24by7.com"  appBase="mybizcrm"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       
                        <Listener className =
"org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
      </Host>

          <Host name="www.renta4wheeler.com"  appBase="renta4wheeler"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       
                        <Listener className =
"org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
      </Host>

                <Listener className = "org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
    </Engine>
  </Service>
        <Listener className = "org.apache.jk.config.ApacheConfig"
workersConfig="C:/Apache/conf/workers.properties"
modJk="C:/Apache/modules/mod_jk.so" jkLog="logs/mod_jk.log" jkDebug="info"
noRoot="false"/>
</Server>

 I'm not very good with this configuring tomcat server.xml.so i'll great
full to receive nice suggestion from you.  

context.xml:

   <Context>

         <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource name="jdbc/vehrentDB" auth="Container"
      type="javax.sql.DataSource"
          maxActive="50"
      maxIdle="30"
                minIdle="10"
          username="******" password="******"      
               
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
             url="jdbc:sqlserver://***********:1433;      
                databaseName=*****;user=******;password=*******;"
      numTestsPerEvictionRun="15"     
timeBetweenEvictionRunsMillis="900000"
        minEvictableIdleTimeMillis="900000"
                testWhileIdle="true"
                testOnBorrow="false"    
                removeAbandoned="true"
                removeAbandonedTimeout="300"
      logAbandoned="true"
        />

        <Resource name="jdbc/empowerDB" auth="Container"
      type="javax.sql.DataSource"
                maxActive="50"
                maxIdle="30"
                minIdle="10"
                username="******" password="*****"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
     
url="jdbc:sqlserver://*******:1433;databaseName=*****;user=*****;password=*******;"
              numTestsPerEvictionRun="15"
timeBetweenEvictionRunsMillis="900000"
              minEvictableIdleTimeMillis="900000"
                testWhileIdle="true"
      testOnBorrow="false"
            removeAbandoned="true"
                removeAbandonedTimeout="300"
      logAbandoned="true"
        />
</Context>
       
Here I'm using the second database empowerDB especially for login purpose
only & rest of the processes are accessing VehrentDB(first one).


Apache2.2 Configuration files:

httpd.conf:

ServerRoot "C:/Apache"
Listen *:80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule ssl_module modules/mod_ssl.so

LoadModule jk_module "C:/Apache/modules/mod_jk.so"

JkLogFile C:/Apache/conf/from_apache_mod_jk.log
JkLogLevel    emerg
JkWorkersFile C:/Apache/conf/workers.properties
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkRequestLogFormat     "%w %V %T"

JkMount /empower ajp13
JkMount /vehrent ajp13

JkMount /empower/* ajp13
JkMount /vehrent/* ajp13

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon

</IfModule>
</IfModule>

ServerAdmin ravi@imbartworks.com
ServerName ************:80
DocumentRoot "C:/Apache/htdocs"
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "C:/Apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

</Directory>
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog "logs/error.log"
LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access.log" common

</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
</IfModule>

<IfModule cgid_module>
</IfModule>
<Directory "C:/Apache/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

DefaultType text/plain
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-ssl.conf


workers.properties:

workers.tomcat_home=C:/Tomcat
workers.java_home=C:/java/jdk1.6.0_16
ps=/
worker.list=worker1
worker.list=worker2
worker.list=supportWorker
worker.list=crmWorker
worker.list=renta4wheelerWorker

worker.worker1.list=ajp13
worker.worker1.ajp13.port=8009
worker.worker1.ajp13.host=empower.mybiz24by7.com
worker.worker1.ajp13.type=ajp13
worker.worker1.ajp13.ping_timeout=1000
worker.worker1.ajp13.connection_pool_timeout=60
worker.worker1.ajp13.connection_pool_size=90
worker.worker1.ajp13.recovery_options=0
worker.worker1.ajp13.connect_timeout=10000
worker.worker1.ajp13.prepost_timeout=10000
worker.worker1.ajp13.reply_timeout=40000
worker.worker1.ajp13.retries=20
worker.worker1.ajp13.socket_timeout=10
worker.worker1.ajp13.lbfactor=5

worker.worker2.list=ajp13
worker.worker2.ajp13.port=8009
worker.worker2.ajp13.host=account.mybiz24by7.com
worker.worker2.ajp13.type=ajp13
worker.worker2.ajp13.lbfactor=1

worker.supportWorker.list=ajp13
worker.supportWorker.ajp13.port=8009
worker.supportWorker.ajp13.host=support.mybiz24by7.com
worker.supportWorker.ajp13.type=ajp13
worker.supportWorker.ajp13.lbfactor=1

worker.crmWorker.list=ajp13
worker.crmWorker.ajp13.port=8009
worker.crmWorker.ajp13.host=crm.mybiz24by7.com
worker.crmWorker.ajp13.type=ajp13
worker.crmWorker.ajp13.lbfactor=1

worker.renta4wheelerWorker.list=ajp13
worker.renta4wheelerWorker.ajp13.port=8009
worker.renta4wheelerWorker.ajp13.host=www.renta4wheeler.com
worker.renta4wheelerWorker.ajp13.type=ajp13
worker.renta4wheelerWorker.ajp13.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.sticky_session=1
worker.loadbalancer.balance_workers= worker1

worker.inprocess.type=jni

httpd-vhosts.conf :

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/corp"
    ServerName XXXXXXX.com
    ServerAlias www.XXXXXXX.com
    ErrorLog "logs/corp-error.log"
    CustomLog "logs/corp-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/imababa"
    ServerName XXXXXXX.com
    ServerAlias www.XXXXXXX.com
    ErrorLog "logs/imababa-error.log"
    CustomLog "logs/imababa-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/ImababaDreams"
    ServerName XXXXXXX.com
    ServerAlias www.XXXXXXX.com
    ErrorLog "logs/imababa-error.log"
    CustomLog "logs/imababa-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/vehrent"
    ServerName XXXXXXX.com
    ServerAlias www.XXXXXXX.com
    ErrorLog "logs/vehrent.log"
    CustomLog "logs/vehrent.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/gateway"
    ServerName empower.XXXXXXX.com
    ServerAlias empower.XXXXXXX.com
    ErrorLog "logs/gateway-error.log"
    CustomLog "logs/gateway-access.log" common

     JkMount /* worker1

    JkUnMount /*js/*.js worker1
    JkUnMount /*.jpeg worker1
    JkUnMount /*.png worker1
    JkUnMount /*.gif worker1
    JkUnMount /*.html worker1
    JkUnMount /*.jpg worker1
    JkUnMount /*.css worker1

</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/account"
    ServerName account.XXXXXXX.com
    ServerAlias account.XXXXXXX.com
    ErrorLog "logs/account-error.log"
    CustomLog "logs/account-access.log" common

    JkMount /* worker2

    JkUnMount /*js/*.js worker2
    JkUnMount /*.jpeg worker2
    JkUnMount /*.png worker2
    JkUnMount /*.gif worker2
    JkUnMount /*.html worker2
    JkUnMount /*.jpg worker2
    JkUnMount /*.css worker2
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/support"
    ServerName support.XXXXXXX.com
    ServerAlias support.XXXXXXX.com
    ErrorLog "logs/support-error.log"
    CustomLog "logs/support-access.log" common

    JkMount /* supportWorker
    JkUnMount /*js/*.js supportWorker
    JkUnMount /*.jpeg supportWorker
    JkUnMount /*.png supportWorker
    JkUnMount /*.gif supportWorker
    JkUnMount /*.html supportWorker
    JkUnMount /*.jpg supportWorker
    JkUnMount /*.css supportWorker
   
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/crm"
    ServerName crm.XXXXXXX.com
    ServerAlias crm.XXXXXXX.com
    ErrorLog "logs/crm.log"
    CustomLog "logs/crm.log" common

    JkMount /* crmWorker
    JkUnMount /*js/*.js crmWorker
    JkUnMount /*.jpeg crmWorker
    JkUnMount /*.png crmWorker
    JkUnMount /*.gif crmWorker
    JkUnMount /*.html crmWorker
    JkUnMount /*.jpg crmWorker
    JkUnMount /*.css crmWorker

</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ravi@imbartworks.com
    DocumentRoot "C:/Apache/htdocs/renta4wheeler"
    ServerName www.XXXXXXX.com
    ServerAlias www.XXXXXXX.com
    ErrorLog "logs/renta4wheeler.log"
    CustomLog "logs/renta4wheeler.log" common

    JkMount /* renta4wheelerWorker
    JkUnMount /*js/*.js renta4wheelerWorker
    JkUnMount /*.jpeg renta4wheelerWorker
    JkUnMount /*.png renta4wheelerWorker
    JkUnMount /*.gif renta4wheelerWorker
    JkUnMount /*.html renta4wheelerWorker
    JkUnMount /*.jpg renta4wheelerWorker
    JkUnMount /*.css renta4wheelerWorker

</VirtualHost>

httpd-ssl.conf :

Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache        "shmcb:C:/Apache/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300
SSLMutex default

<VirtualHost _default_:443>
DocumentRoot "C:/Apache/htdocs/gateway"
ServerName empower.XXXXXX.com
ServerAdmin ravi@imbartworks.com
ErrorLog "C:/Apache/logs/sss-error.log"

SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile C:/Apache/conf/empower.XXXXXXXX.com.crt
SSLCertificateKeyFile C:/Apache/conf/empower.XXXXXX.com.key
       
        JkMount /* worker1
        JkMount /*dwr/* worker1

    JkUnMount /*js/*.js worker1
    JkUnMount /*.jpeg worker1
    JkUnMount /*.png worker1
    JkUnMount /*.gif worker1
    JkUnMount /*.html worker1
    JkUnMount /*.jpg worker1
    JkUnMount /*.css worker1
    JkUnMount /*.swf worker1
SSLCertificateChainFile "C:/Apache/conf/empower.XXXXX.com.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/Apache/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog "C:/Apache/logs/ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>                                  

These are the files i'm using in Apache & Tomcat servers for the
configuration.I'm giving the JVM parameter's as follows,
1)Initial Memory Pool     -2560
2)Maximum memory pool-2560
3)Thread size              -I don't  know what to set exactly.


I'm very eagerly waiting for the nice reply to proceed further.Can anyone
please tell where i'm going wrong

    Thanks in advance. 
-- 
View this message in context: http://old.nabble.com/How-to-configure-tomcat-server.xml....-tp27575197p28165705.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Mime
View raw message