Oracle Audio Technologies A86828-01 User Manual

Oracle9i Application Server
Oracle HTTP Server powered by Apache Performance Guide
Release 1.0.2 for AIX-Based Sys te m s, C om paq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, an d Sun Solaris Intel
October 2000 Part No. A86828-01
Copyright © 2000, Oracle Corporation. All rights reserved. Authors: Pallavi Bhowmik, and Julia Pond. Contributors: Corinne Arne, Rupesh Das, Danielle Higgins, Prashanth Joshi, Rajesh
Konanganparambath, Saurabh Pandey, and Sriram V.R. Nagaraja Rao .
The Programs (which include both the softw are and docume nta tion) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial prop erty law s . R e vers e en gi nee rin g, disassembly , or decompilation of the Programs is prohibited.
The information containe d in this document is subject to change without notice. If you fin d any problem s in the documentation, please report the m to us in writing. Oracle Corporation does not warrant that thi s doc um e nt is error free. Except as may be expressly permitte d in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express writt e n pe r m iss ion of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the followin g not ic e is app lic able:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disc losure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Reg ul ations are "restricted computer software" and use, duplic ation, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software ­Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the lice nse e ’s responsibility to take all app ropriate fa il-safe, backup, redundancy, and other measures to ensure the sa fe use of such ap plications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs.
Oracle is a registered trademark, and the Oracle Logo, Internet App lic ation Server, Oracle8i, Oracle Enterprise Manager, Oracle Internet Directory, and PL/SQL are trademarks or registered trademarks of Oracle Corporation. All other company or product names me nt ione d are used for iden tif ic ation purposes only and may be trademarks of their respective owners.
This product includes software developed b y th e A pache Group for use in the Apache HTTP server project (http://www.apache.org/).
This product includes software developed by the OpenSSL project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptograp hic sof tware written by Eric Young (eay@cryptsoft.com). This product includes software written by Tim Hudson (tjh@cryptsoft.com).
This product includes software developed by Ralf S. Engelschall (rse@engelschall.com) for use in the mod_ssl project (http://www.modssl.org/).
Contents
Send Us Your Comments.................................................................................................................. vii
Preface............................................................................................................................................................ ix
1 Performance Overview
Performance Terms............................................................................................................................. 1-2
What is Performance Tuning? .......................................................................................................... 1-2
Response Time.............................................................................................................................. 1-3
System Throughput...................................................................................................................... 1-4
Wait Time....................................................................................................................................... 1-4
Critical Resources......................................................................................................................... 1-5
Effects of Excessive Demand....................................................................................................... 1-6
Adjustments to Relieve Problems.............................................................................................. 1-6
Setting Performance Targets............................................................................................................. 1-7
Setting User Expectations.................................................................................................................. 1-7
Evaluating Performance .................................................................................................................... 1-7
Performance Methodology ............................................................................................................... 1-8
Factors in Improving Performance............................................................................................ 1-9
Architecture........................................................................................................................................ 1-10
2 Monitoring Your Web Server
Monitoring Processor Use................................................................................................................. 2-2
Using the sar Utility (AIX, HP-UX, Intel Solaris)..................................................................... 2-2
Using the top Utility ..................................................................................................................... 2-3
iii
Monitoring the Web Server............................................................................................................... 2-3
Using the mod_status Utility...................................................................................................... 2-4
Logging Server Statistics to a File............................................................................................... 2-6
Monitoring JServ Processes.............................................................................................................. 2-8
3 Sizing and Configuration
Sizing your Hardware and Resources............................................................................................. 3-1
Understanding Concurrent Users and User Population ............................................................. 3-1
Determining CPU Requirements.................................................................................................... 3-3
Secure Sockets Layer Impact on CPU Requirements.............................................................. 3-3
Determining Memory Requirements.............................................................................................. 3-3
Memory for Non-HTTP Server Software and Operating System ......................................... 3-4
HTTP Server Memory Requirements ........................................................................................ 3-4
JServ Memory Requirements...................................................................................................... 3-4
Determining Java Heap Size....................................................................................................... 3-4
Servlet and OracleJSP pages Memory Requirements.............................................................. 3-5
Number of JServ Processes.......................................................................................................... 3-6
4 Optimizing HTTP Server Performance
TCP Tuning .......................................................................................................................................... 4-2
Linux Tunables........................................................ ..... ................................................................. 4-4
MaxClients ........................................................................................................................................... 4-9
SSL Session Caching........................................................................................................................ 4-10
Impact of Logging............................................................................................................................. 4-10
HTTP/1.1............................................................................................................................................. 4-11
Persistent Connections............................................................................................................... 4-11
Apache Versions...................................................... ...... ..... ...... ......................................................... 4-14
5 Optimizing Apache JServ
JServ Overview.................................................................................................................................... 5-2
Optimizing Servlet Performance..................................................................................................... 5-3
Loading Servlet Classes............................................................................................................... 5-3
Automatic Class Reloading......................................................................................................... 5-3
Load Balancing.............................................................................................................................. 5-4
iv
Using Single Thread Model Servlets.......................................................................................... 5-7
What is OracleJSP?............................................................................................................................. 5-8
OracleJSP Page Performance Tuning.............................................................................................. 5-8
Impact of Session Management.................................................................................................. 5-8
Developer Mode .................................. ...... ...... ............................................................................. 5-9
Buffering ........................................................................................................................................ 5-9
Enhancing OracleJSP Performance............................................................................................ 5-9
Index
v
vi

Send Us Your Comments

Oracle9i Application Server, Oracle HTTP Server powered by Apache Performance Guide, Release 1.0.2
Part No. A86828-01
Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this publication. Your input is an important part of the information used for revision.
Did you find any errors?
Is the information clearly presented?
Do you need more information? If so, where?
Are the examples correct? Do you need more examples?
What features did you like most about this manual?
If you find any errors or have any other suggestions for improvement, please indicate the chapter, section, and page number (if available). You can send comments to us in the following ways:
E-mail - iasdocs_us@oracle.com
Postal service:
Oracle Corporation 500 Oracle Parkway, M/S 6op4 Redwood Shores, CA 94065 USA
If you would like a reply, please give your name, address, and telephone number below.
If you have problems with the software, please contact your local Oracle Support Services.
vii
viii
Audience
Assumptions
Conventions

Preface

This guide is written for Oracle Internet Application Server 8i developers and system administrators who are responsible for configuring and tuning the Oracle HTTP Server powered by Apache.
There are many sources of information on configuring and tuning web servers, Apache in particular. This guide refers to those sources when expedient, and, where practical, quantifies the performance gains resulting from configuration actions found in those sources. Any recommendations not validated by our in-house testing are cited as such, with attribution to the origina l source.
All of our in-house tests were run on a dedicated 100 Mbps network, in order to achieve repeatable test results. Your results wil l vary based on network configuration and contention characteristics.
This manual uses the following typographical conventions:
Convention Example Explanation
bold tnsnames.ora
runInstaller www .oracle.com
Identifies file names, utilities, processes, and URLs
ix
Convention Example Explanation
italics file1 Identifies a variable in text; replace this place
holder with a specific value or string.
angle brackets <filename> Identifies a variable in code; replace this
place holder with a specific value or string.
courier owsctl start wrb Text to be entered exactly as it appears. Also
used for functions.
square brackets [-c string]
[on|off]
Identifies an optional item. Identifies a choice of optional items, each
separated by a verti c al bar (|), any one option can be specified.
braces {yes|no} Identifies a choice of mandatory items, each
ellipses n,... Indicates that the preceding item can be
The term, Oracle Server, refers to the database server product from Oracle Corporation.
The term, oracle, refers to an executable or account by that name. The term, oracle, refers to the owner of the Oracle software.
Oracle Services and Support
A wide range of information about Oracle products and global services is available from:
http://www.oracle.com
The sections below provide URLs for selected services.
Oracle Support Services
Technical Support contact information worldwide is listed at:
http://www.oracle.com/support
Templates are provided to help you prepare information about your problem before you call. You will also need your CSI number (if applicable) or complete contact details, including any special project information.
separated by a verti c al bar (|).
repeated any number of times.
x
Product and Documentation
For U.S.A customers, Oracle Store is at:
http://store.oracle.com
Links to Stores in other countries are provided from this site. Product documentation can be found at:
http://docs.oracle.com
Customer Service
Global Customer Service contacts are listed at:
http://www.oracle.com/support
Education and Training
Training information and worldwide schedules are available from:
http://education.oracle.com
Oracle Technology Network
Register with the Oracle Technology Network (OTN) at:
http://technet.oracle.com
OTN delivers technical papers, code samples, product documentation, self-service developer support, and Oracle key developer products to enable rapid development and deployment of application built on Oracle technology.
xi
xii
Contents
1

Performance Overview

This chapter discusses performance and tuning concepts, and briefly describes Oracle9i Application Server architecture.
Performance Terms
What is Performance Tuning?
Setting Performance Targets
Setting User Expectations
Evaluating Performance
Performance Methodology
Architecture
Performance Overview 1-1

Performan ce Terms

Performance Terms
Following are performance terms used in this book:
concurrency The ability to handle multiple requests simulta neously.
latency The time that one system component spends waiting for
response time The time between the submission of a request and the
scalability The ability of a system to provide throughput in
Threads and processes are examples of concurrency mechanisms.
another component in order to complete the entire task. Latency can be defined as wasted time. In networking discussions, latency is defined as the travel time of a packet from source to destination.
completion of the response.
proportion to, and limited only by, available hardware resources.
A scalable system is one that can handle increasing numbers of requests without adversely affecting response time and throughput.
service time The time between the initiation and completion of the
response to a request.
think time The time the user is not engaged in actual use of the
processor.
throughput The number of requests processed per unit of time. wait time The time between the submission of the request and
initiation of the response.

What is Performance Tuning?

Performance must be built in. You must anticipate performance requirements during application analysis and design, and balance the costs and benefits of optimal performance (see "Setting Performance Targets" on page 1-7). This section introduces some fundamental concepts:
Response Time
System Throughput
1-2 Oracle HTTP Server powered by Apache Performance Guide

Response Time

What is Performance Tuning?
Wait Time
Critical Resources
Effects of Excessive Demand
Adjustments to Relieve Problems
Because response time equals service time plus wait time, you can increase performance in this area by:
Reducing wait time
Reducing service time
Figure 1–1 illustrates ten independent tasks competin g for a single resource.
Figure 1–1 Sequential processing of independent tasks
In this example, only task 1 runs without waiting. Task 2 must wait until task 1 has completed; task 3 must wait until tasks 1 and 2 have completed, and so on. (Although the figure shows the independent tasks as the same size, the size of the tasks will vary .)
Performance Overview 1-3
What is Performance Tuning?
In parallel processing with multiple resources, more resources are available to the tasks. Each independent task executes immediately using its own resource: no wait time is involved.

System Throughput

System throughput is the amount of work accomplished in a given amount of time. You can increase throughput by:
Reducing service time
Reducing overall response time by increasing the amount of scarce resources
available. For example, if the system is CPU bound, and you can add more CPUs.

Wait Time

While the service time for a task may stay the same, wait time will lengthen with increased contention. If many users are waiting for a service that takes one second, the tenth user must wait 9 seconds. Figure 1–2 shows the relationship between wait
time and resource contention.
Figure 1–2 Wait time rising with increased contention for a resource
1-4 Oracle HTTP Server powered by Apache Performance Guide

Critical Resources

Resources such as CPU, memory, I/O capacity, and network bandwidth are key to reducing service time. Adding resources incr eases thr oughput and r educes response time. Performance depends on these factors:
How many resources are available?
How many clients need the resource?
How long must they wait for the resource?
How long do they hold the resource?
Figure 1–3 shows that as the number of units requested rises, the time to service completion rises.
Figure 1–3 Time to service completion vs. demand rate
What is Performance Tuning?
To manage this situation, you have two options:
Limit demand rate to maintain acceptable response times
Add resources
Performance Overview 1-5
What is Performance Tuning?

Effects of Excessive Demand

Excessive demand increases response time and reduces throughput, as shown in
Figure 1–4. If there is any possibility of the demand rate exceeding the achievable
throughput, a demand limiter (such as MaxClients in the Oracle HTTP Server and security.maxConnections in JServ) is essential. Look at the possible demands that may be placed on the system and design the application or configure the system with these cons traints in mind.
Figure 1–4 Increased Demand/Reduced Throughput

Adjustments to Relieve Problems

Performance problems can be relieved by making adjustments in the following areas:
unit consumption Reducing the resource (CPU, memory)
consumption of each request can improve performance. This might be achieved by pooling and caching.
functional demand Rescheduling or redistributing the work
will relieve some problems.
capacity Increasing or reallocating resources (e.g.,
CPUs) relieves some problems.
1-6 Oracle HTTP Server powered by Apache Performance Guide

Setting Performance Targets

Whether you are designing or maintaining a system, you should set specific performance goals so that you know how and what to optimize. If you alter parameters without a specific goal in mind, you can waste time tuning your s ystem without significant gain.
An example of a specific performance goal is an order entry response time under three seconds. If the application does not meet that goal, identify the cause (for example, I/O contention), and take corrective action. During development, test the application to determine if it meets the designed performance goals.
Tuning usually involves a series of trade-offs. Once you have determined the bottlenecks, you may have to modify performance in some other areas to achieve the desired results. For example, if I/O is a problem, you may need to purchase more memory or more disks. If a purchase is not possible, you may have to limit the concurrency of the system to achieve the desired performance. However, if you have clearly defined goals for performance, the decision on what to trade for higher performance is simpler because you have identified the most important areas.

Setting User Expectations

Evaluating Performance

Application developers, database administrators, and system administrators must be careful to set appropriate performance expectations for users. When the system carries out a particularly complicated operation, response time may be slower than when it is performing a simple operation. Users should be made aware of which operations might take longer.
Evaluating Performance
With clearly defined performance goals, you can readily determine when performance tuning has been successful. Success depends on the functional objectives you have established with the user community, your ability to measure whether or not the criteria are being met, and your ability to take corrective action to overcome any exceptions.
Ongoing performance monitoring enables you to maintain a well tuned system.
Keeping a history of the application’s performance over time enables you to make useful comparisons. With data about actual resource consumption for a range of loads, you can conduct objective scalabilit y studies and from these predict the resource requirements for anticipated load volumes.
Performance Overview 1-7

Performance Methodology

Performance Methodology
Achieving optimal effectiveness in your system requires planning, monitoring, and periodic adjustment. The first step in performance tuning is to determine the goals you need to achieve and to design effective usage of available technology into your applications. After implementing your system, it is necessary to periodically monitor and adjust your system For example, you might want to ensure that 90% of the users experience response times no greater than 5 seconds and the maximum
response time for all users is 20 seconds. Usually, it’s not that simple. Your application may include a variety of operations with differing characteristics and acceptable response times. You will need to set measurable goals for each of these.
Figure 1–5 Adjusting Capacity and Functional Demand
You w ill also need to determine variances in the load. For example, users might access the system heavily between 9:00am and 10:00am and then again between 1:00pm and 2:00pm. If your peak load occurs on a regular basis, for example, daily or weekly, the conventional wisdom is to configure and tune systems to meet your peak load requirements. The lucky users who access the application in off-time will typically achieve better response times than your peak-time users. If your peak load is infrequent, you may be willing to tolerate higher response times at peak loads for the cost savings of smaller hardware configurations.
1-8 Oracle HTTP Server powered by Apache Performance Guide

Factors in Improving Performance

Performance spans several areas:
Application design: Designing applications that efficiently utilize hardware
resources and handle increasing numbers of users effectively.
Sizing and configuration: Determining the type of hardware needed to support
your performance goals. See Chapter 3, "Sizing and Configuration".
Parameter tuning: Setting configurable parameters to achieve the best
performance for your application. See Chapter 5, "Optimizing Apache JServ" and Chapter 4, "Optimizing HTTP Server Performance".
Performance monitoring: Determining what hardware resources are being used
by your application and what response time your users are experiencing. See
Chapter 2, "Monitoring Your Web Server".
Troubleshooting: Diagnosing why an applica tion is using excessive hardware
resources, or why the response time exceeds the desired limit.
Performance Methodology
Performance Overview 1-9
Loading...
+ 47 hidden pages