BrainDump
  Home arrow BrainDump arrow Page 4 - Benchmarking Tomcat Performance
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
BRAINDUMP

Benchmarking Tomcat Performance
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 1
    2009-02-19


    Table of Contents:
  • Benchmarking Tomcat Performance
  • Web Server Performance Comparison
  • Benchmarked hardware and software configurations
  • Building the APR Connector

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Benchmarking Tomcat Performance - Building the APR Connector
    ( Page 4 of 4 )

     

    We built the APR connector like this:

      # CFLAGS="-O3 -falign-functions=0 -march=athlon64 -mfpmath=sse -mmmx -msse -msse2 -
      msse3 -m3dnow -mtune=athlon64" ./configure --with-apr=/usr/bin/apr-1-config --
      prefix=/opt/tomcat/apr-connector
      # make && make install

    We used the same CFLAGS when building Apache httpd  and mod_jk . Here’s how we built and installed mod_jk :

      # cd tomcat-connectors-1.2.20-src/native
      # CFLAGS="-O3 -falign-functions=0 -march=athlon64 -mfpmath=sse -mmmx -msse -msse2 -
      msse3 -m3dnow -mtune=athlon64" ./configure --with-apxs=/opt/httpd/bin/apxs
     
    [lots of configuration output removed]
     
    # make && make install

    This assumes that the root directory of the Apache httpd  we built is /opt/httpd .

    We built the APR connector, httpd , and mod_jk  with GCC 4.1.1:

      # gcc --version
      gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30)
      Copyright (C) 2006 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions. There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    We downloaded Apache httpd  version 2.2.3 from http://httpd.apache.org and built it two different ways and benchmarked each of the resulting binaries. We built it for prefork MPM and worker MPM. These are different multithreading and multiprocess models that the server can use. Here are the settings we used for prefork and worker MPM:

      # prefork MPM
      <IfModule prefork.c>
     
    StartServers       8
      MinSpareServers    5
      MaxSpareServers   20
      ServerLimit      256
      MaxClients       256
      MaxRequestsPerChild 4000
      </IfModule>

      # worker MPM
      <IfModule worker.c>
      StartServers         3
      MaxClients         192
      MinSpareThreads      1
      MaxSpareThreads     64
      ThreadsPerChild     64
      MaxRequestsPerChild  0
      </IfModule>

    We disabled Apache httpd ’s common access log so that it would not need to log any thing per each request (just as we configured Tomcat). And, we turned on Apache httpd ’s KeepAlive configuration option:

      KeepAlive O n
      MaxKeepAliveRequests 100
      KeepAliveTimeout 5

    We enabled mod_proxy  one of two ways at a time. First, for proxying via HTTP:

    ProxyPass /tc http://127.0.0.1:8080/

    ProxyPassReverse /tc http://127.0.0.1:8080/

    Or, for proxying via AJP:

      ProxyPass        /tc ajp://127.0.0.1:8009/
      ProxyPassReverse /tc ajp://127.0.0.1:8009/

    And, we configured mod_jk  by adding this to httpd.conf :

    LoadModule jk_module /opt/httpd/modules/mod_jk.so

    JkWorkersFile /opt/httpd/conf/workers.properties

    JkLogFile /opt/httpd/logs/mod_jk.log

    JkLogLevel info

    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

    JkRequestLogFormat "%w %V %T"

    JkMount /tc/* worker1

    Plus we created a workers.properties  file for mod_jk  at the path we specified in the httpd.conf file:

      worker.list=worker1 
      worker.worker1.type=ajp13
      worker.worker1.host=localhost
      worker.worker1.port=8009
      worker.worker1.connection_pool_size=150
      worker.worker1.connection_pool_timeout=600
      worker.worker1.socket_keepalive=1

    Of course, we enabled only one Apache httpd connector module at a time in the configuration.

    Please check back next week for the continuation of this article.



     
     
    >>> More BrainDump Articles          >>> More By O'Reilly Media
     

       

    BRAINDUMP ARTICLES

    - Migrating Oracle to PostgreSQL with Enterpri...
    - Demystifying SELinux on Kernel 2.6
    - Yahoo and Microsoft Create Ad Partnership
    - The Advantages of Obscure Open Source Browse...
    - Dell Announces CSI-style Digital Forensics S...
    - Milepost GCC Speeds Open-Source Development
    - Learn These 10 Programming Languages
    - Tomcat Capacity Planning
    - Internal and External Performance Tuning wit...
    - Tomcat Benchmark Procedure
    - Benchmarking Tomcat Performance
    - Tomcat Performance Tuning
    - Wubi: Windows-based Ubuntu Installer
    - Configuring and Optimizing Your I/O Scheduler
    - Linux I/O Schedulers





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek