Sun Microsystems Sun Java System Web Server 7.0 Manual
Sun Microsystems Sun Java System Web Server 7.0 Manual

Sun Microsystems Sun Java System Web Server 7.0 Manual

Update 1 performancetuning, sizing, and scaling guide
Table of Contents

Advertisement

Quick Links

Sun Java System Web Server 7.0
Update 1 Performance Tuning,
Sizing, and Scaling Guide
Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054
U.S.A.
Part No: 820–1067

Advertisement

Table of Contents
loading

Summary of Contents for Sun Microsystems Sun Java System Web Server 7.0

  • Page 1 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 820–1067...
  • Page 2 Etats-Unis et dans d'autres pays; elle est licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, JavaServer Pages, JSP, JVM, JDBC, Java HotSpot, Java et Solaris sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc.
  • Page 3: Table Of Contents

    Contents Preface ..............................11 Performance and Monitoring Overview ..................19 Performance Issues ..........................19 Configuration ............................20 Virtual Servers ............................. 20 Server Farms ............................21 64–Bit Servers ............................21 SSL Performance ..........................21 Monitoring Server Performance ......................22 About Statistics ..........................23 Monitoring Current Activity Using the Admin Console ............
  • Page 4 Tuning CGI Stub Processes (UNIX/Linux) ..................81 Using find-pathinfo-forward ......................82 Using nostat ............................82 Using Busy Functions ......................... 83 Common Performance Problems ......................85 check-acl Server Application Functions ................... 85 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 5 Contents Low-Memory Situations ........................86 Too Few Threads ..........................86 Cache Not Utilized ..........................87 Keep-Alive Connections Flushed ...................... 87 Log File Modes ............................. 88 Platform-Specific Issues and Tips ..................... 89 Solaris Platform-Specific Issues ......................89 Files Open in a Single Process (File Descriptor Limits) ............89 Failure to Connect to HTTP Server ...................
  • Page 6 SSL Performance Test: Perl CGI ....................119 SSL Performance Test: C CGI ....................120 SSL Performance Test: NSAPI ....................121 E-Commerce Web Application Test ..................122 Index ..............................127 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 7 Tables Methods of Monitoring Performance ..............22 TABLE 1–1 Parameter Mapping to server.xml ................ 46 TABLE 2–1 Connection Queue Statistics ..................50 TABLE 2–2 Keep-Alive Statistics ....................53 TABLE 2–3 File Cache Statistics ....................60 TABLE 2–4 Thread Pools Statistics ....................66 TABLE 2–5 DNS Cache Statistics ....................
  • Page 8 SSL Performance Test: NSAPI Scalability ............122 TABLE 6–19 Performance Test Pass Criteria ................124 TABLE 6–20 E-Commerce Web Application Scalability ............125 TABLE 6–21 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 9 Figures Web Server Connection Handling ................40 FIGURE 2–1...
  • Page 11: Preface

    Preface This guide discusses adjustments you can make that may improve the performance of Sun Java System Web Server (henceforth known as Web Server). The guide provides tuning, scaling, and sizing tips and suggestions; possible solutions to common performance problems; and data from scalability studies.
  • Page 12 Sun Java System Web Server 7.0 Update 1 NSAPI Creating custom Netscape Server Application Programmer’s Interface Developer’s Guide (NSAPI) plug-ins Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 13: Related Books

    Books in the Web Server Documentation Set (Continued) TABLE P–1 Documentation Title Contents Sun Java System Web Server 7.0 Update 1 Developer’s Implementing Java Servlets and JavaServer Pages (JSP ) technology in Guide to Java Web Applications Sun Java System Web Server Sun Java System Web Server 7.0 Update 1 Administrator’s...
  • Page 14 For stand-alone installations, the default location for instance on Solaris, Linux, and HP-UX:install-dir For stand-alone installations, the default location for instance on Windows: system-drive:\Program Files\sun\WebServer7 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 15: Typographic Conventions

    Preface Typographic Conventions The following table describes the typographic changes that are used in this book. Typographic Conventions TABLE P–3 Typeface Meaning Example The names of commands, files, and Edit your .login file. AaBbCc123 directories, and onscreen computer Use ls -a to list all files. output machine_name% you have mail.
  • Page 16 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 17: Sun Welcomes Your Comments

    Preface Sun Welcomes Your Comments Sun is interested in improving its documentation and welcomes your comments and suggestions. To share your comments, go to and click Send Comments. http://docs.sun.com In the online form, provide the full document title and part number. The part number is a 7-digit or 9-digit number that can be found on the book's title page or in the document's URL.
  • Page 19: Performance And Monitoring Overview

    C H A P T E R Performance and Monitoring Overview Sun Java System Web Server (henceforth known as Web Server) is designed to meet the needs of the most demanding, high-traffic sites in the world. It can serve both static and dynamically generated content.
  • Page 20: Configuration

    For more information about using the quality of service features, see Sun Java System Web Server 7.0 Update 1 Administrator’s Guide. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 21: Server Farms

    SSL Performance Server Farms The clustering features of Web Server allow you to easily deploy to a server farm. Because all servers in a server farm share identical configurations, tuning is not done on a server-by-server basis. 64–Bit Servers The performance for the 64–bit Web Server is not necessarily better than the performance for the 32–bit Web Server, but the 64–bit server scales better.
  • Page 22: Monitoring Server Performance

    Monitoring the server does have some impact on computing resources. In general, using perfdump through the URI is the least costly, followed by using stats-xml through a URI. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 23: About Statistics

    Monitoring Server Performance Because using the Administration Server takes computing resources, the command-line interface and the Admin Console are the most costly monitoring methods. For more information on these monitoring methods, see the following sections: “About Statistics” on page 23 ■...
  • Page 24: Enabling Statistics

    The minimum value is .001 seconds; the default value is 5 seconds. Profiling is activated by default. Deactivating it results in slightly less monitoring overhead. ■ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 25: Monitoring Current Activity Using The Admin Console

    Monitoring Server Performance Restart the server. ▼ To Enable Statistics from the CLI Enter the following CLI command to enable statistics collection: ./wadm set-stats-prop --user=admin_user –password-file=password-file --config=myconfig enabled=true To disable statistics, set enabled to false. To set the interval and enable profiling, use the set-stats-prop interval and profiling properties.
  • Page 26: Monitoring Current Activity Using The Cli

    Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 27 Monitoring Server Performance process.1.timeStarted=Jan 5, 2007 2:20:53 PM process.1.DNSCache.countCacheHits=687804 process.1.DNSCache.countAsyncNameLookup=0 process.1.DNSCache.countAsyncLookupsInProgress=0 process.1.DNSCache.flagAsyncEnabled=false process.1.DNSCache.countAsyncAddrLookups=0 process.1.DNSCache.flagCacheEnabled=true process.1.DNSCache.countCacheMisses=75 process.1.JDBCPool.1.countQueued=32 process.1.JDBCPool.1.countFreeConnections=0 process.1.JDBCPool.1.peakConnections=32 process.1.JDBCPool.1.millisecondsPeakWait=72 process.1.JDBCPool.1.countWaitQueueTimeouts=288 process.1.JDBCPool.1.peakQueued=64 process.1.JDBCPool.1.maxConnections=32 process.1.JDBCPool.1.currentConnections=32 process.1.JDBCPool.1.millisecondsAverageQueued=1.0 process.1.JDBCPool.1.countTotalFailedValidationConnections=0 process.1.JDBCPool.1.countLeasedConnections=32 process.1.JDBCPool.1.countTotalLeasedConnections=414 process.1.JDBCPool.1.countConnectionIdleTimeouts=1 process.1.JDBCPool.1.name=jdbc/jdbc-simple_1 process.1.connectionQueue.1.countQueued15MinuteAverage=4.3203125 process.1.connectionQueue.1.countQueued=0 process.1.connectionQueue.1.countQueued1MinuteAverage=0.046875 process.1.connectionQueue.1.countTotalQueued=79171 process.1.connectionQueue.1.countQueued5MinuteAverage=4.03125 process.1.connectionQueue.1.countOverflows=0 process.1.connectionQueue.1.maxQueued=1288 process.1.connectionQueue.1.ticksTotalQueued=724956383 process.1.connectionQueue.1.countTotalConnections=863 process.1.connectionQueue.1.peakQueued=64 process.1.connectionQueue.1.name=cq1 process.1.fileCache.countContentMisses=7 process.1.fileCache.maxMmapCacheSize=0 process.1.fileCache.sizeHeapCache=27520...
  • Page 28 Using the node option restricts the output to a single node. To get statistics for a deployed web application, enter: ./wadm get-webapp-stats --user=admin-user --password-file=admin-password-file --config=config-name --node=node-name --vs=virtual-server-name --uri=URI Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 29: Monitoring Current Activity Using Stats.xml

    Monitoring Server Performance The syntax gets the statistics for a given web application deployed on the given virtual server of the given instance. To get the aggregated web application statistics for a given configuration across all the nodes where the configuration has been deployed, use the command without the node option.
  • Page 30: To Enable The Stats-Xml Uri From The Cli

    ■ connection-queue connection-queue-bucket (process-level) ■ ■ cpu-info ■ dns-bucket ■ jdbc-resource-bucket ■ keepalive-bucket ■ process ■ profile profile-bucket (process-level) ■ ■ request-bucket ■ servlet-bucket Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 31: To View Stats-Xml Output From The Cli

    Monitoring Server Performance ■ session-replication ■ thread ■ thread-pool thread-pool-bucket (process-level) ■ ■ virtual-server ■ web-app-bucket ▼ To View stats-xml Output from the CLI In addition to a URI, you can also access stats-xml output through the command-line interface. It is enabled by default. Unlike viewing stats-xml output through the URI, the Administration Server must be running to view stats-xml output at the command-line.
  • Page 32: To Enable The Perfdump Uri From The Cli

    You can request the perfdump statistics and specify how frequently (in seconds) the browser should automatically refresh. The following example sets the refresh to every 5 seconds: http://yourhost/.perf?refresh=5 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 33: To View The Perfdump Data From The Cli

    The output appears in your command window. Sample perfdump Output The following is sample perfdump output: webservd pid: 29133 Sun Java System Web Server 7.0 B07/13/2006 17:09 (SunOS DOMESTIC) Server started Fri Jul 14 14:34:15 2006 Process 29133 started Fri Jul 14 14:34:17 2006 ConnectionQueue:...
  • Page 34 29133 response 10.5.8.19 4 https-test GET /perf service-dump 29133 response 192.6.7.7 3 https-test GET /qa_webapp/CheckNetwork.class service-j2ee 29133 response 192.6.7.7 3 https-test GET /qa_webapp/CheckNetwork.class service-j2ee Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 35 Monitoring Server Performance 29133 response 192.6.7.7 2 https-test GET /qa_webapp/CheckNetwork.class service-j2ee 29133 response 192.6.7.7 2 https-test GET /qa_webapp/CheckNetwork.class service-j2ee 29133 response 192.6.7.7 2 https-test GET /qa_webapp/CheckNetwork.class service-j2ee 29133 response 192.6.7.7 2 https-test GET /qa_webapp/CheckNetwork.class service-j2ee 29133 request 192.6.7.7 0 29133 request 192.6.7.7 0 29133...
  • Page 36: Performance Report

    ObjectType fn="force-type" type="magnus-internal/cgi" Service fn="send-cgi" bucket="cgi-bucket" </Object> For more information, see “The bucket Parameter” in Sun Java System Web Server 7.0 Update 1 Administrator’s Configuration File Reference. Performance Report The server statistics in buckets can be accessed using perfdump. The performance buckets information is located in the last section of the report returned by perfdump.
  • Page 37: Monitoring Current Activity Using The Java Es Monitoring Console

    Monitoring Server Performance Number of Invocations is the total number of times that the function was invoked. This ■ differs from the number of requests in that a function could be called multiple times while processing one request. The percentage column for this row is calculated in reference to the total number of invocations for all of the buckets.
  • Page 39: Tuning Sun Java System Web Server

    C H A P T E R Tuning Sun Java System Web Server This chapter describes specific adjustments you can make that might improve Sun Java System Web Server performance. It provides an overview of Web Server's connection-handling process so that you can better understand the tuning settings. The chapter includes the following topics: “General Tuning Tips”...
  • Page 40: Understanding Threads, Processes, And Connections

    Solaris upgrade, you should start over with an unmodified /etc/system file. Stay informed ■ Read the Sun Java System Web Server 7.0 Update 1 Release Notes and the release notes for your operating system whenever you upgrade your system. The release notes often provide updated information about specific adjustments.
  • Page 41 Understanding Threads, Processes, and Connections A request processing thread might also be instructed to send the request to a different thread pool for processing. For example, if the request processing thread must perform some work that is not thread-safe, it might be instructed to send part of the processing to the NativePool. Once the NativePool completes its work, it communicates the result to the request processing thread and the request processing thread continues processing the request.
  • Page 42: Custom Thread Pools

    NameTrans directive. 2. If the URI starts with /testmod, the A1 thread queues the request to the my-custom-pool queue. The A1 thread waits. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 43: The Native Thread Pool

    Understanding Threads, Processes, and Connections 3. A different thread in my-custom-pool, called the B1 thread in this example, picks up the request queued by A1. B1 completes the request and returns to the wait stage. 4. The A1 thread wakes up and continues processing the request. It executes the ObjectType SAF and moves on to the Service function.
  • Page 44: Process Modes

    Because applications on Windows generally already take advantage of multi-thread considerations, this feature applies to UNIX and Linux platforms. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 45 Maximum Threads and serialize access to the legacy application using thread pools. For more information about creating a thread pool, see “thread-pool-init” in Sun Java System Web Server 7.0 Update 1 Administrator’s Configuration File Reference.
  • Page 46: Mapping Web Server 6.1 Tuning Parameters To Web Server 7.0

    HTTP tab property dns-cache-init Init SAF enabled element of the Configuration's set-dns-cache-prop Performance tab ⇒ dns-cache element command's enabled DNS tab property Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 47 Mapping Web Server 6.1 Tuning Parameters to Web Server 7.0 Parameter Mapping to server.xml (Continued) TABLE 2–1 Web Server 7.0 server.xml Web Server 6.1 parameter element or attribute Admin Console Location wadm command dns-cache-init Init SAF max-entries element of Configuration's set-dns-cache-prop Performance tab ⇒...
  • Page 48: Using Monitoring Data To Tune Your Server

    In addition, the statistics information displayed through the Admin Console, the command-line interface, and stats-xml contains other categories not contained in the perfdump output. Tuning these statistics is discussed in the following sections: Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 49: Connection Queue Information

    Using Monitoring Data to Tune Your Server “Java Virtual Machine (JVM) Information” on page 70 ■ “Web Application Information” on page 71 ■ “JDBC Resource Information” on page 72 ■ Once you have viewed the statistics you need, you can tune various aspects of your server’s performance at the configuration level using the Admin Console's Performance tab.
  • Page 50: Connection Queue Statistics

    Total Connections Queued is the total number of times a connection has been queued. This number includes newly-accepted connections and connections from the keep-alive system. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 51: Http Listener (Listen Socket) Information

    Using Monitoring Data to Tune Your Server This setting is not tunable. Average Queue Length The Average Queue Length shows the average number of connections in the queue over the last one-minute, five-minute, and 15–minute intervals. This setting is not tunable. Average Queuing Delay The Average Queueing Delay is the average amount of time a connection spends in the connection queue.
  • Page 52 Other HTTP listener settings that affect performance are the size of the send buffer and receive buffer. For more information regarding these buffers, see your operating system documentation. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 53: Keep-Alive Information

    Using Monitoring Data to Tune Your Server Default Virtual Server Virtual servers work using the HTTP 1.1 Host header. If the end user’s browser does not send the Host header, or if the server cannot find the virtual server specified by the Host header, Web Server handles the request using a default virtual server.
  • Page 54 Number of connections in keep-alive mode (total number of connections added) ■ Maximum number of connections allowed in keep-alive mode simultaneously (maximum ■ connection size) Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 55 Using Monitoring Data to Tune Your Server Tuning You can tune the maximum number of connections that the server allows to wait at one time before closing the oldest connection in the Admin Console by editing the Maximum Connections field on the configuration's Performance tab ⇒ HTTP tab, under Keep Alive Settings.
  • Page 56 If there's idle CPU time, decrease the poll interval. ■ If there's no idle CPU time, increase the poll interval. ■ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 57: Session Creation (Thread) Information

    Using Monitoring Data to Tune Your Server Also, chunked encoding could affect the performance for HTTP 1.1 workload. Tuning the response buffer size could positively affect the performance. A higher response buffer size in the configuration's Performance tab ⇒ HTTP tab would result in sending a Content-length: header, instead of chunking the response.
  • Page 58 Both of these factors add to the maximum simultaneous requests that are required. If your site is processing many requests that take many seconds, you might need to increase the number of maximum simultaneous requests. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 59: File Cache Information (Static Content)

    Using Monitoring Data to Tune Your Server Suitable maximum threads values range from 100-500, depending on the load. Maximum Threads represents a hard limit for the maximum number of active threads that can run simultaneously, which can become a bottleneck for performance. The default value is 128. The thread pool minimum threads is the minimum number of threads the server initiates upon startup.
  • Page 60 File Cache Entries number because the accelerator cache only caches information about files and not directories. If the number is significantly lower than the Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 61 Using Monitoring Data to Tune Your Server File Cache Entries number, you can improve the accelerator cache utilization by following the tuning information described in “Acceleratable Requests” on page 61 “Acceleratable Responses” on page Acceleratable Requests The number of client requests that were eligible for processing by the accelerator cache. Only simple GET requests are processed by the accelerator cache.
  • Page 62 An entry older than the maximum age is replaced by a new entry for the same file. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 63 Using Monitoring Data to Tune Your Server Tuning Set the maximum age based on whether the content is updated (existing files are modified) on a regular schedule. For example, if content is updated four times a day at regular intervals, you could set the maximum age to 21600 seconds (6 hours).
  • Page 64: File Cache Dynamic Control And Monitoring

    Number of outdated cache entries deleted = 0 Number of cache entry replacements = 0 Total number of cache entries deleted = 0 Parameter settings Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 65: Thread Pool Information

    Using Monitoring Data to Tune Your Server ReplaceFiles: false ReplaceInterval: 1 milliseconds HitOrder: false CacheFileContent: true TransmitFile: false MaxAge: 3600 seconds MaxFiles: 600000 files SmallFileSizeLimit: 500000 bytes MediumFileSizeLimit: 1000001 bytes BufferSize: 8192 bytes CopyFiles: false Directory for temporary files: /tmp Hash table size: 1200007 buckets You can include a query string when you access the URI.
  • Page 66 The Work Queue Length is the current number of requests waiting for a native thread, which is represented as Requests Queued in the Admin Console. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 67 Using Monitoring Data to Tune Your Server Peak (Peak Requests Queued in the Admin Console) is the highest number of requests that were ever queued up simultaneously for the use of a native thread since the server was started. This value can be viewed as the maximum concurrency for requests requiring a native thread.
  • Page 68: Dns Cache Information

    IP address. DNS cache is enabled by default. The following example shows DNS cache information as displayed in perfdump: DNSCacheInfo: ------------------ enabled Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 69 Using Monitoring Data to Tune Your Server CacheEntries 4/1024 HitRatio 62854802/62862912 ( 99.99%) AsyncDNS Data: ------------------ enabled NameLookups AddrLookups LookupsInProgress The following example shows the DNS Cache information as displayed in the Admin Console: DNS Cache Statistics TABLE 2–6 Total Cache Hits 62854802 Total Cache Misses 6110...
  • Page 70: Java Virtual Machine (Jvm) Information

    Virtual Machine Version 1.5.0_06-b05 Heap Memory Size 5884856 Elapsed Garbage Collection Time (milli seconds) Present Number of Classes Loaded 1795 Total Number of Classes Loaded 1795 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 71: Web Application Information

    Using Monitoring Data to Tune Your Server Java Virtual Machine (JVM) Statistics (Continued) TABLE 2–7 Total Number of Classes Unloaded Number of Garbage Collections Occurred Number of Live Threads Number of Started Threads Peak Live Thread Count Most of these statistics are not tunable. They provide information about the JVM's operation. Another source of tuning information on the JVM is the package java.lang.management, which provides the management interface for monitoring and management of the JVM.
  • Page 72: Jdbc Resource Information

    For more information on tuning, see “Tuning Java Web Application Performance” on page Also see Sun Java System Web Server 7.0 Update 1 Developer’s Guide to Java Web Applications. JDBC Resource Information A JDBC resource is a named group of JDBC connections to a database. A JDBC resource defines the properties used to create a connection pool.
  • Page 73: Jdbc Resource Statistics

    Using Monitoring Data to Tune Your Server The use of connection pooling improves application performance by doing the following: Creating connections in advance. The cost of establishing connections is moved outside of ■ the code that is critical for performance. Reusing connections.
  • Page 74 Admin Console, on the Edit JDBC Resource page, edit the Maximum Connections field. To change the JDBC resource's maximum connections through the command-line-interface, use wadm set-jdbc-resource-prop and change the max-connections property. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 75 Using Monitoring Data to Tune Your Server JDBC Resource Statistics Not Available in the Admin Console Some JDBC statistics are available through the wadm get-config-stats command (using the --node option), through stats-xml, and through SNMP but not through the Admin Console. maxConnections –...
  • Page 76 ■ number of drivers also cache the results of this method. Validation Table Name ■ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 77: Tuning The Acl User Cache

    Tuning the ACL User Cache The user-defined table to use for validation when the validation method is table. Defaults to test. If this method is used, the table used should be dedicated only to validation, and the number of rows in the table should be kept to a minimum. Fail All Connections ■...
  • Page 78: Tuning Java Web Application Performance

    When the server detects a change in a .jsp file, only that JSP is recompiled and reloaded; the entire web application is not reloaded. If your JSPs don't change, you can improve performance by precompiling your JSPs. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 79: Using Servlet/Jsp Caching

    To enable caching, you configure the caching parameters in the sun-web.xml file of your application. For more details, see “Caching Servlet Results” in Sun Java System Web Server 7.0 Update 1 Developer’s Guide to Java Web Applications.
  • Page 80: Avoiding Directories In The Classpath

    For more information about these settings, see Chapter 6, “Session Managers, ” in Sun Java System Web Server 7.0 Update 1 Developer’s Guide to Java Web Applications. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 81: Tuning Cgi Stub Processes (Unix/Linux)

    The following example describes the effect on process size when configuring the persistence-type="mmap" using the manager-properties properties. For more information, see “MMap Session Manager (UNIX Only)” in Sun Java System Web Server 7.0 Update 1 Developer’s Guide to Java Web Applications.
  • Page 82: Using Find-Pathinfo-Forward

    On Windows, you can also use this feature to prevent the server from changing "\\" to "/" when using the PathCheck server function find-pathinfo. For more information about obj.conf, see the Sun Java System Web Server 7.0 Update 1 Administrator’s Configuration File Reference.
  • Page 83: Using Busy Functions

    NSAPI plug-in URLs. Using nostat on those URLs improves performance by avoiding unnecessary stats on those URLs. For more information about obj.conf, see the Sun Java System Web Server 7.0 Update 1 Administrator’s Configuration File Reference.
  • Page 85: Common Performance Problems

    C H A P T E R Common Performance Problems This chapter discusses common web site performance problems, and includes the following topics: “check-acl Server Application Functions” on page 85 ■ “Low-Memory Situations” on page 86 ■ “Too Few Threads” on page 86 ■...
  • Page 86: Low-Memory Situations

    The best way to tell if your server is being throttled by too few threads is to see if the number of active sessions is close to, or equal to, the maximum number of threads. To do this, see “Session Creation (Thread) Information” on page Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 87: Cache Not Utilized

    Keep-Alive Connections Flushed Cache Not Utilized If the file cache is not utilized, your server is not performing optimally. Since most sites have lots of GIF or JPEG files that should always be cacheable, you need to use your cache effectively. Some sites, however, do almost everything through CGIs, SHTML, or other dynamic sources.
  • Page 88: Log File Modes

    Fine, Finer, and Finest with care. To set the log level using the CLI, use the command wadm set-log-prop and set the log-level. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 89: Platform-Specific Issues And Tips

    C H A P T E R Platform-Specific Issues and Tips This chapter provides platform-specific tuning tips, and includes the following topics: “Solaris Platform-Specific Issues” on page 89 ■ “Solaris File System Tuning” on page 93 ■ “Solaris Platform-Specific Performance Monitoring” on page 94 ■...
  • Page 90: Failure To Connect To Http Server

    This adjustment is not expected to have any adverse impact in any web hosting environment, so you can consider this suggestion even if your system is not showing the symptoms mentioned. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 91: Connection Refused Errors

    Solaris Platform-Specific Issues Connection Refused Errors If users are experiencing connection refused errors on a heavily loaded server, you can tune the use of network resources on the server. When a TCP/IP connection is closed, the port is not reused for the duration of tcp_time_wait_interval (default value of 240000 milliseconds).
  • Page 92: To Enable Snca To Work With Web Server

    The thread pool can also be disabled with non-SNCA configurations, especially for cases in which short latency responses with no keep-alives must be delivered. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 93: Solaris File System Tuning

    Solaris File System Tuning Solaris File System Tuning This section discusses changes that can be made for file system tuning, and includes topics that address the following issues: “High File System Page-In Rate” on page 93 ■ “Reduce File System Housekeeping” on page 93 ■...
  • Page 94: Solaris Platform-Specific Performance Monitoring

    CPU time; if this remains higher than about four times the number of CPUs, you might need to reduce the server's concurrency. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 95: Long-Term System Monitoring

    Solaris 10 Platform-Specific Tuning Information The mpstat 60 command gives a detailed look at CPU statistics, while the netstat -i 60 ■ command summarizes network activity. Long-Term System Monitoring It is important not only to "spot-check" system performance with the tools mentioned above, but to collect longer-term performance histories so you can detect trends.
  • Page 96: Tuning Solaris For Performance Benchmarking

    /dev/tcp amounts of data. 8129 32768 To increase the transmit buffer. tcp_xmit_hiwat ndd /dev/tcp 8129 32768 To increase the receive buffer. tcp_recv_hiwat ndd /dev/tcp Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 97: Tuning Ultrasparc T1-Based Systems For Performance Benchmarking

    Tuning UltraSPARC® T1–Based Systems for Performance Benchmarking Tuning UltraSPARC® T1–Based Systems for Performance Benchmarking Use a combination of tunable parameters and other parameters to tune your system for performance benchmarking. These values are an example of how you might tune your system to achieve the desired result.
  • Page 98: Disk Configuration

    [ $numpsr -gt 0 ]; shift numpsr=‘expr $numpsr - 1‘ tmp=1 while [ $tmp -ne 4 ]; /usr/sbin/psradm -i $1 shift numpsr=‘expr $numpsr - 1‘ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 99: Web Server Start Options

    Tuning UltraSPARC® T1–Based Systems for Performance Benchmarking tmp=‘expr $tmp + 1‘ done done Put all network interfaces into a single group. For example: $ifconfig ipge0 group webserver $ifconfig ipge1 group webserver Web Server Start Options In some cases, performance can be improved by using large page sizes. To start the 32–bit Web Server with 4 MB pages: LD_PRELOAD_32=/usr/lib/mpss.so.1 ;...
  • Page 101: Sizing And Scaling Your Server

    C H A P T E R Sizing and Scaling Your Server This chapter examines the subsystems of your server, and provides recommendations for optimal performance. The chapter includes the following topics: “64-Bit Server” on page 101 ■ “Processors” on page 101 ■...
  • Page 102: Memory

    Gigabit Ethernet technology. For an intranet site, your network is unlikely to be a bottleneck. However, you can use the same calculations as above to verify this. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 103: Scalability Studies

    C H A P T E R Scalability Studies This chapter describes the results of scalability studies. You can refer to these studies for a sample of how the server performs, and how you might configure your system to best take advantage of Web Server’s strengths.
  • Page 104: Study Conclusion

    “Hardware for E-Commerce Test” on page 122. Web Server system configuration for static content: Sun Microsystems Sun Fire T2000 (120 MHz, 8 cores) (only six cores were used for this test) ■ 16256 Megabytes of memory ■ Solaris 10 operating system ■...
  • Page 105: Software

    Configuration and Tuning Software The load driver for these tests was an internally-developed Java application framework called the Faban driver. Configuration and Tuning The following tuning settings are common to all the tests in this study. Individual studies may also have additional configuration and tuning information. /etc/system tuning: set rlim_fd_max=500000 set rlim_fd_cur=500000...
  • Page 106: Network Configuration

    The following example shows psrinfo output after running the script: on-line since 12/06/2006 14:28:34 no-intr since 12/07/2006 09:17:04 no-intr since 12/07/2006 09:17:04 no-intr since 12/07/2006 09:17:04 on-line since 12/06/2006 14:28:35 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 107: Web Server Tuning

    Configuration and Tuning no-intr since 12/07/2006 09:17:04 ....Web Server Tuning The following table shows the tuning settings used for the Web Server. Web Server Tuning Settings TABLE 6–1 Component Default Tuned Access logging enabled=true enabled=false Thread pool min-threads=16 min-threads=128 max-threads=128 max-threads=200 stack-size=131072...
  • Page 108: Performance Tests And Results

    Multiple network interfaces were configured. ■ Web Server was configured with 64 bit. ■ File-cache was enabled with the tuning settings described in the following table. ■ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 109: File Cache Configuration

    Performance Tests and Results File Cache Configuration TABLE 6–3 Default Tuned enabled=true enabled=true max-age=30 sec max-age=3600 max-entries=1024 max-entries=1048576 sendfile=false sendfile=true max-heap-file-size=524288 max-heap-file-size=1200000 max-heap-space=10485760 max-heap-space=8000000000 max-mmap-file-size=0 max-mmap-file-size=1048576 max-mmap-space=0 max-mmap-space= l max-open-files=1048576 The following table shows the static content scalability results. Static Content Scalability TABLE 6–4 Number Of Cores Average Throughput (ops/sec)
  • Page 110: Dynamic Content Test: Servlet

    The following table shows the JVM tuning settings used in the test. JVM Tuning Settings TABLE 6–5 Default Tuned -Xmx128m -server -Xrs -Xmx2048m -Xms2048m -Xmn2024m -XX:+AggressiveHeap -XX:LargePageSizeInBytes=256m -Xms256m -XX:+UseParallelOldGC -XX:+UseParallelGC -XX:ParallelGCThreads=<number of cores> -XX:+DisableExplicitGC Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 111: Dynamic Content Test: C Cgi

    Performance Tests and Results The following table shows the results for the dynamic content servlet test. Dynamic Content Test: Servlet Scalability TABLE 6–6 Number Of Cores Average Throughput (ops/sec) Average Response Time (ms) 5287 10492 15579 The following is a graphical representation of servlet scalability results. Servlet Scalability 16000 15000...
  • Page 112: Cgi Tuning Settings

    The following is a graphical representation of C CGI scalability results. C CGI Scalability 2400 2300 2200 2100 2000 1900 1800 1700 Throughput 1600 1500 1400 1300 1200 1100 1000 Number of cores Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 113: Dynamic Content Test: Perl Cgi

    Performance Tests and Results Dynamic Content Test: Perl CGI This test was conducted with Perl script called printenv.pl that prints the CGI environment. CGI tuning settings were applied to the server. The goal was to saturate the cores on the server and find out the respective throughput and response time.
  • Page 114: Dynamic Content Test: Nsapi

    TABLE 6–11 Number Of Cores Average Throughput (ops/sec) Average Response Time (ms) 6264 12520 18417 The following is a graphical representation of NSAPI scalability results. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 115: Php Scalability Tests

    PHP version 5.1.6. The tests were performed in two modes: An out-of-process fastcgi-php application invoked using the FastCGI plug-in available for ■ Sun Java System Web Server 7.0 (the download will be available from http://www.zend.com/sun/). In-process PHP NSAPI plug-in. ■...
  • Page 116: Tuning Settings For Fastcgi Plug-In Test

    TABLE 6–13 Number of Cores Average Throughput (ops/sec) Average Response Time (ms) 1706 2475 The following is a graphical representation of PHP scalability with Fast CGI. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 117: Nsapi Plug-In Configuration For Php

    Performance Tests and Results PHP Scalability With Fast CGI 2500 2400 2300 2200 2100 2000 1900 1800 1700 Throughput 1600 1500 1400 1300 1200 1100 1000 Number of cores PHP Scalability with NSAPI The following table shows the Web Server tuning settings for the PHP with NSAPI test. NSAPI Plug-in Configuration for PHP TABLE 6–14 magnus.conf...
  • Page 118: Ssl Performance Test: Static Content

    The file cache was enabled and tuned using the settings in Table 6–3. ■ The SSL session cache was tuned using the settings in Table 6–2. ■ Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 119: Ssl Performance Test: Perl Cgi

    Performance Tests and Results Web Server is configured with 64 bit ■ The following table shows the SSL static content test results. SSL Performance Test: Static Content Scalability TABLE 6–16 Number of Cores Average Throughput (ops/sec) Average Response Time (ms) 2284 4538 6799...
  • Page 120: Ssl Performance Test: C Cgi

    SSL session cache enabled. The goal was to saturate the cores on the server and find out the respective throughput and response time. The following table shows the SSL CGI test results. Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 121: Ssl Performance Test: Nsapi

    Performance Tests and Results SSL Performance Test: C CGI Scalability TABLE 6–18 Number of Cores Average Throughput (ops/sec) Average Response Time (ms) 1499 2127 The following is a graphical representation of C CGI scalability with SSL. C CGI Scalability With SSL 2200 2100 2000...
  • Page 122: E-Commerce Web Application Test

    Hardware for E-Commerce Test The e-commerce studies were conducted using the following hardware. Web Server system configuration: Sun Microsystems Sun Fire 880 ( 900MHz US-III+). Only four CPUs were used for this test. ■ 16384 Megabytes of memory. ■...
  • Page 123 Performance Tests and Results Database system configuration: Sun Microsystems Sun Fire 880 ( 900MHz US-III+) ■ 16384 Megabytes of memory ■ Solaris 10 operating system ■ Oracle 10.1.0.2.0 ■ Driver system configuration: Sun Microsystems Sun Fire 880 ( 900MHz US-III+) ■...
  • Page 124: Performance Test Pass Criteria

    The maximum number of concurrent users that the system can support was based on the following passing criteria. Performance Test Pass Criteria TABLE 6–20 Transaction 90th Percentile Response Time (Seconds) HomeStart AdminConfirm AdminRequest BestSellers BuyConfirm Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 125: E-Commerce Web Application Scalability

    Performance Tests and Results Performance Test Pass Criteria (Continued) TABLE 6–20 Transaction 90th Percentile Response Time (Seconds) BuyRequest CustomerRegistration Home NewProducts OrderDisplay OrderInquiry ProductDetail SearchRequest SearchResults ShoppingCart The following table shows the e-commerce web application test results. E-Commerce Web Application Scalability TABLE 6–21 Number of CPUs Users...
  • Page 126 The following is a graphical representation of e-commerce web application scalability. E-commerce Web Application Scalability 1350 1300 1250 1200 1150 1100 1050 Throughput 1000 Number of CPUs Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 127: Index

    Index Numbers and Symbols cache not utilized, 87 64–bit servers caching, servlet/JSP, 79 performance advantages, 21 cgi-bucket, 36 scaling, 101 CGIStub processes, 81 check-acl SAF, 85 class-loader, 79 class reloading, configuring, 79 classpath, directories in, 80 acceptor threads, 52 configurations access time updates, 93 and performance, 20 acl-bucket, 36...
  • Page 128 Solaris, 93-94 ipge:ipge_srv_fifo_depth, 97 find-pathinfo-forward, 82 ipge:ipge_taskq_disable, 97 find-pathinfo function, 82 ipge:ipge_tx_ring_size, 97 flushed keep-alive connections, 87-88 free connections, in JDBC resources, 74 ipge:ipge_tx_syncq, 97 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 129 Index LateInit, 81 Java ES monitoring console, 37 LDAP server, and ACL user cache, 77 Java heap tuning, 71 leased connections, in JDBC resources, 74 Java HotSpot VM, 71 listen socket, statistics, 51 java.lang.OutOfMemoryError, 86 load driver, for studies, 105 Java Security Manager, configuring, 79 load-modules function, 43 Java VM heap space, 86...
  • Page 130 64 too few threads, 86 performance buckets, 36 process modes, 44-46 UseOutputStreamSize parameter, 57 processes, 40-46 processors, sizing issues, 101 profiling, 24 page sizes, 99 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...
  • Page 131 Index sq_max_size, 91, 96, 97 SSL performance, 21 quality of service start options, 99 features, 20 statistics statistics and, 24 activating, 24-25 queued connections, in JDBC resources, 74 connection queue, 49 file cache information, 59 listen socket information, 51 monitoring, 23 ratio, hit, 62 performance buckets, 35 reapIntervalSeconds, 80...
  • Page 132 UNIX file system, 93 using statistics to tune your server, 48-77 validation method, JDBC resource, 76 validation table name, JDBC resource, 76 virtual servers default, 53 Sun Java System Web Server 7.0 Update 1 Performance Tuning, Sizing, and Scaling Guide •...

Table of Contents