Oracle Oracle9i Application Manual

Release 1.0.2 for aix-based systems, compaq tru64 unix, hp 9000 series hp-ux, linux intel, and sun solaris intel
Hide thumbs Also See for Oracle9i:
Table of Contents

Advertisement

Oracle9 i Application Server
Oracle HTTP Server powered by Apache Performance Guide
Release 1.0.2 for AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX,
Linux Intel, and Sun Solaris Intel
October 2000
Part No. A86828-01

Advertisement

Table of Contents
loading

Summary of Contents for Oracle Oracle9i

  • Page 1 Oracle9 i Application Server Oracle HTTP Server powered by Apache Performance Guide Release 1.0.2 for AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris Intel October 2000 Part No. A86828-01...
  • Page 2 Oracle9i Application Server Oracle HTTP Server powered by Apache Performance Guide, Release 1.0.2 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.
  • Page 3: Table Of Contents

    Contents Send Us Your Comments ........................vii Preface ................................ix 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 ....................
  • Page 4 Monitoring the Web Server....................... Using the mod_status Utility ...................... 2-4 Logging Server Statistics to a File....................2-6 Monitoring JServ Processes ......................2-8 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 ..............
  • Page 5 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...
  • Page 7: Send Us Your Comments

    Send Us Your Comments Oracle9 i 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?
  • Page 8 viii...
  • Page 9: Preface

    Preface Audience 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. Assumptions There are many sources of information on configuring and tuning web servers, Apache in particular.
  • Page 10 Convention Example Explanation italics file1 Identifies a variable in text; replace this place holder with a specific value or string. angle brackets Identifies a variable in code; replace this <filename> place holder with a specific value or string. courier Text to be entered exactly as it appears. Also owsctl start wrb used for functions.
  • Page 11 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...
  • Page 13: Performance Overview

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

    Performance Terms Performance Terms Following are performance terms used in this book: concurrency The ability to handle multiple requests simultaneously. Threads and processes are examples of concurrency mechanisms. latency The time that one system component spends waiting for another component in order to complete the entire task. Latency can be defined as wasted time.
  • Page 15: Response Time

    What is Performance Tuning? Wait Time Critical Resources Effects of Excessive Demand Adjustments to Relieve Problems Response Time 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 competing for a single resource.
  • Page 16: System Throughput

    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...
  • Page 17: Critical Resources

    What is Performance Tuning? Critical Resources Resources such as CPU, memory, I/O capacity, and network bandwidth are key to reducing service time. Adding resources increases throughput and reduces 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?
  • Page 18: Effects Of Excessive Demand

    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.
  • Page 19: Setting Performance Targets

    Evaluating Performance 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 system without significant gain.
  • Page 20: Performance Methodology

    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.
  • Page 21: Factors In Improving Performance

    Performance Methodology 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".
  • Page 22: Architecture

    Oracle HTTP Server powered by Apache Apache JServ OracleJSP See the Oracle9i Application Server Overview Guide for a list of publications that describe other components. Figure 1–6 Oracle9i Application Server architecture 1-10 Oracle HTTP Server powered by Apache Performance Guide...
  • Page 23: Monitoring Your Web Server

    Monitoring Your Web Server This chapter describes utilities and processes you can use to gather information from your system. This information helps you to determine the best use of your resources. Contents Monitoring Processor Use Monitoring the Web Server Monitoring the Web Server Monitoring JServ Processes Monitoring Your Web Server 2-1...
  • Page 24: Monitoring Processor Use

    Monitoring Processor Use Monitoring Processor Use To determine process utilization, you should gather CPU statistics. You should also monitor system scalability by adding users and increasing the system workload. Use utilities such as sar (System Activity Reporter) and mpstat to monitor process use.
  • Page 25: Using The Top Utility

    Monitoring the Web Server The sar command (-u option) provides the following statistics: Table 2–1 CPU statistics, as reported by the sar utility CPU Statistics Description percentage of time in which the processor is running in user %usr mode percentage of processes running in system time %sys percentage the processor spends waiting on I/O requests %wio...
  • Page 26: Using The Mod_Status Utility

    Monitoring the Web Server Using the mod_status Utility To enable monitoring, edit the httpd.conf file to replace your_domain.com with the hostname of the server you want to monitor. <Location /server-status> SetHandler server-status Order deny, allow Deny from all Allow from your_domain.com </Location>...
  • Page 27 Monitoring the Web Server Figure 2–1 Server status page Interpreting Server Status Information The display (with ExtendedStatus enabled) shows that 6 requests are being processed and four servers are idle. You can determine what stage of processing each server is in from the value in the M (Mode column). In Figure 2–1, 6 servers are sending replies and 4 servers are waiting for connections.
  • Page 28: Logging Server Statistics To A File

    Monitoring the Web Server has been completed, there is a W in the M (mode) column for the process, the process is probably not responding. Another situation that is important to monitor is that of the system being CPU bound, where CPU utilization is around 90%. The server status page displays CPU usage and the number of processes spawned.
  • Page 29 Monitoring the Web Server The script is designed to be run by cron (or an equivalent daemon that executes commands at intervals). To use the script, you must modify the following configuration variables: Table 2–2 Log status script variables Variable Value The pathname of the log file location, for example: $wherelog...
  • Page 30: Monitoring Jserv Processes

    Monitoring JServ Processes Monitoring JServ Processes After you start the Oracle9i Application Server, you can check to ensure that all JServ processes have started normally. Remove the comments in the JServ status handler section of the jserv.conf file to enable monitoring and specify the host(s) that can access JServ status (the default is localhost).
  • Page 31 Monitoring JServ Processes Figure 2–3 JServ status display The Status column shows the current shared memory (shm) state of each process. Monitoring Your Web Server 2-9...
  • Page 32 Monitoring JServ Processes The Status column is populated only for processes that are Note: started in manual mode. It is not populated for a single process started in automatic mode. The symbols that appear in parentheses after the word Up or Down have the following meanings: Symbol Meaning...
  • Page 33: Sizing And Configuration

    Sizing and Configuration This chapter provides guidelines for sizing and configuration which can help you meet performance goals. It also discusses performance factors, such as memory consumption, I/O issues, and network and software constraints. Contents Sizing your Hardware and Resources Understanding Concurrent Users and User Population Determining CPU Requirements Determining Memory Requirements...
  • Page 34 Understanding Concurrent Users and User Population relationship between the number of potential users and the number of concurrent users. This is determined by the think time and the average response time for your application. To determine memory requirements, you also need to consider the number of concurrent executing users (not the total user population) times the cost per user.
  • Page 35: Determining Cpu Requirements

    Determining Memory Requirements Determining CPU Requirements For most applications, the majority of the CPU utilization is spent in processing the application’s code. The CPU requirement of any application depends on its complexity and workload, as shown in Table 3–2. You will need to monitor the CPU requirements of applications throughout the development cycle.
  • Page 36: Memory For Non-Http Server Software And Operating System

    Determining Memory Requirements Memory for Non-HTTP Server Software and Operating System HTTP Server Memory Requirements JServ Memory Requirements Determining Java Heap Size Servlet and OracleJSP pages Memory Requirements Number of JServ Processes Memory for Non-HTTP Server Software and Operating System In an idle system with memory resources freely available, your operating system statistics may indicate that the resident memory usage is close to the virtual size.
  • Page 37: Servlet And Oraclejsp Pages Memory Requirements

    Determining Memory Requirements To maximize performance, set the maximum heap size to accommodate application requirements. To determine how much Java heap you need, include calls in your program to the Runtime.getRuntime().totalMemory() and Runtime.getRuntime().freeMemory methods in the java.lang package. Subtract free memory from total memory; the difference is the amount of heap that the application consumed.
  • Page 38: Number Of Jserv Processes

    Determining Memory Requirements The amount of memory needed depends on whether sessions are used; a session consumes about 0.5KB. For maximum performance, if sessions are not being used, turn them off in the OracleJSP application as follows: <%@ page session=”false” %> <html><body>...
  • Page 39 Determining Memory Requirements Figure 3–1 Request distribution Sizing and Configuration 3-7...
  • Page 40 Determining Memory Requirements 3-8 Oracle HTTP Server powered by Apache Performance Guide...
  • Page 41: Optimizing Http Server Performance

    Optimizing HTTP Server Performance This chapter provides information on improving the Oracle HTTP Server’s performance, including tuning TCP parameters, the effects of changing the MaxClients parameter, SSL caching, and logging. Contents TCP Tuning MaxClients SSL Session Caching Impact of Logging HTTP/1.1 Apache Versions Optimizing HTTP Server Performance 4-1...
  • Page 42: Tcp Tuning

    TCP Tuning TCP Tuning Correctly tuned TCP parameters can improve performance dramatically. This section contains recommendations for TCP tuning and a brief explanation of each parameter. The table below contains recommended TCP parameter settings. Table 4–1 Recommended TCP parameter settings for Intel Solaris Parameter Setting Comments...
  • Page 43 TCP Tuning Table 4–2 Tuning HP-UX for Performance Benchmarking Tuned Parameter Scope Default Value Value 60,000 60,000 tcp_time_wait_interval ndd/dev/tcp 1,024 tcp_conn_req_max ndd/dev/tcp 600,000 60,000 tcp_ip_abort_interval ndd/dev/tcp 7,20,00,000 900,000 tcp_keepalive_interval ndd/dev/tcp 1,500 1,500 tcp_rexmit_interval_initial ndd/dev/tcp 60,000 60,000 tcp_rexmit_interval_max ndd/dev/tcp tcp_rexmit_interval_min ndd/dev/tcp 32,768 32,768 tcp_xmit_hiwater_def...
  • Page 44: Linux Tunables

    TCP Tuning Table 4–4 AIX TCP Parameters (using no command) Default Parameter Model Value Recommended Value rfc1323 /etc/rc.net 65,536 1,31,072 sb_max /etc/rc.net 1,024 tcp_mssdflt /etc/rc.net ipqmaxlen /etc/rc.net 16,384 65,536 tcp_sendspace /etc/rc.net 16,384 65,536 tcp_recvspace /etc/rc.net xmt_que_size /etc/rc.net Linux Tunables Raising Network Limits on Linux Systems for 2.1.100 or greater Linux only allows you to use 15 bits of the TCP window field.
  • Page 45 TCP Tuning You will find some other possibilities to tune TCP in /proc/sys/net/ipv4/: tcp_timestamps tcp_windowscaling tcp_sack There is a brief description of TCP parameters in /Documentation/networking/ip-sysctl.txt. Tuning at Compile Time All the above TCP parameter values are set default by a header file in the Linux kernel source directory /LINUX-SOURCE-DIR/include/linux/skbuff.h These values are default.
  • Page 46 TCP Tuning With the tuned TCP stacks, it was possible to get a maximum throughput between 1.5 and 1.8 Mbits via a 2Mbit satellite link, measured with netperf. Setting TCP parameters To set the connection table hash parameter, on Intel Solaris, you must add the following line to your /etc/system file, and then restart the system: set tcp:tcp_conn_hash_size=32768 On Tru64, tcbhashsize can be set at /etc/sysconfigtab.
  • Page 47 TCP Tuning Specifying Retention time for Connection Table entries The TCP connection table maintains data associated with connections. The server maintains a TCP connection table entry for some time after a connection is closed, so that it can identify and properly dispose of any leftover incoming packets from the client.
  • Page 48 TCP Tuning On most web servers, the defaults will be sufficient, but if you have more than 1024 concurrent users, these settings may be too low. In that case, connections will be dropped in the handshake state because the queues are full. You can determine whether this is a problem on your system by inspecting the values for tcpListenDrop, tcpListenDropQ0, and tcpHalfOpenDrop with netstat -s.
  • Page 49: Maxclients

    You can configure this parameter in the httpd.conf file up to a maximum of 1024 in Oracle9i Application Server v. 1.0.2 (in the previous version, the maximum was 256). The default is 150, which should be adequate for most uses.
  • Page 50: Ssl Session Caching

    SSL Session Caching could be reduced, to act as a throttle on the number of concurrent requests on the server. SSL Session Caching The Oracle HTTP server caches a client’s SSL session information by default. With session caching, only the first connection to the server incurs high latency. For example, in a simple test to connect and disconnect to an SSL-enabled server, the elapsed time for 5 connections was 11.4 seconds without SSL session caching.
  • Page 51: Http/1.1

    HTTP/1.1 to log IP addresses. You can resolve IP addresses to host names off-line, with the logresolve utility (found in the $ORACLE_HOME/Apache/Apache/bin/ directory). For more information, see Dale Gaudet’s Apache Perfor ance Notes at: http://www.apache.org/docs/misc/perf-tuning.html Error logging The server notes unusual activity in an error log. The ErrorLog and LogLevel directives identify the log file and the level of detail of the messages recorded.
  • Page 52 HTTP/1.1 Shorter Response Times Persistent connections can improve total response time for a web interaction that involves multiple HTTP requests, because the delay of setting up a connection only happens once. Consider the total time required, without persistent connections, for a client to retrieve a web page with three images from the server.
  • Page 53 HTTP/1.1 This is a 20% reduction in service time. When the system is under load, the benefit of reducing connection time with persistent connections is even greater, due to the corresponding reduction of the TCP queue. Reduction in Server Workload Another benefit of persistent connections is reduction of the work load on the server.
  • Page 54: Apache Versions

    Apache Versions The problem is that when a connection becomes idle, and the server closes it because the keep alive time limit has expired, the client host may not perform the TCP protocol steps required to complete the closure of the connection. The host, having sent the close request, is left with the connection in the FIN_WAIT_2 state taking up memory until it gets the appropriate packets back from the client, or until an internal flush occurs.
  • Page 55: Optimizing Apache Jserv

    Optimizing Apache JServ This chapter describes the JServ architecture, and discusses ways you can improve its performance. It also includes performance information on OracleJSP pages (the Oracle implementation of Sun Microsystems’ JavaServer Pages 1.1.) Contents JServ Overview Optimizing Servlet Performance What is OracleJSP? OracleJSP Page Performance Tuning Optimizing Apache JServ 5-1...
  • Page 56: Jserv Overview

    JServ Overview JServ Overview Apache JServ is made up of an Apache module called mod_jserv, which runs in the httpd process, and a servlet engine, which runs in a Java process. mod_jserv, which is implemented in C, functions as a dispatcher, routing each servlet request to a JServ process for execution.
  • Page 57: Optimizing Servlet Performance

    Optimizing Servlet Performance Optimizing Servlet Performance This section discusses strategies for optimizing JServ performance: loading servlets when starting the JVM, and load balancing. The terms “repository” and “zone” are used in this discussion. Servlets, repositories, and zones are analogous to files, directories and virtual hosts. A servlet is a single unit, a repository is a collection of servlets, and a zone is a collection of repositories.
  • Page 58: Load Balancing

    Optimizing Servlet Performance parameters to false, since there is a performance cost in checking the repositories on every execution of a servlet. Change these parameters in the zone properties file: autoreload.classes=false autoreload.file=false Load Balancing It is often beneficial to spread the servlet application load among multiple JServ processes, especially when the application is run on a multiprocessor or if the servlets and HTTP server are run on separate nodes.
  • Page 59 Optimizing Servlet Performance Edit jserv2.properties as follows: port=8002 log.file=/usr/local/jserv/logs/jserv2.log If your HTTP server will be running on a different host than Note: the JServ processes, you must also add the IP address of the host running the HTTP server to the security.allowedAddresses parameter in each jserv.properties file.
  • Page 60 Optimizing Servlet Performance ApJServHost JServ2 ajpv12://127.0.0.1:8002 ApJServRoute JS1 JServ1 ApJServRoute JS2 JServ2 ApJServShmFile /usr/local/apache/logs/jserv_shm The ApJServMount directive, with /servlets balance://set/root, now balances requests for servlets in /servlets between JServ1 and JServ2. The ApJServBalance directive identifies JServ1 and JServ2 as the processes that share the load.
  • Page 61: Using Single Thread Model Servlets

    Optimizing Servlet Performance If the request is not part of a session, mod_jserv selects an engine based on the process ID of the httpd process and the number of entries in the list of available JServs, as follows: JServ_id to handle the request = httpd_pid % number of JServs in the list This method distributes requests across the available JServ engines fairly evenly.
  • Page 62: What Is Oraclejsp

    What is OracleJSP? singleThreadModelServlet.initialCapacity = 10 singleThreadModelServlet.incrementCapacity = 0 singleThreadModelServlet.maximumCapacity = 10 The value for Warning: singleThreadModelServlet.maximumCapacity in the zone properties file must be at least as large as the value for security.maxConnections in the jserv.properties file. If it is not, and the number of requests sent to the JServ process exceeds the maximum capacity, requests will fail.
  • Page 63: Developer Mode

    OracleJSP Page Performance Tuning Developer Mode Another parameter that has a significant effect on performance is developer mode. It is a useful feature for debugging during development, but it degrades performance. The default value is true, so you will need to set it to false in the jserv.properties file as follows: servlet.oracle.jsp.JspServlet.initArgs=developer_mode=false With developer mode set to true, OracleJSP and the servlet engine examines every...
  • Page 64 OracleJSP Page Performance Tuning Update statement batching The JDBC driver accumulates a number of execution requests (the batch value) and passes them to the database to be processed at the same time. You can configure the batch value to control how frequently processing occurs. JDBC statement caching Cache executable statements that are repeatedly used, to avoid re-parsing, statement object recreation, and recalculation of parameter size definitions.
  • Page 65 Index Apache JServ Protocol 1.2, 5-2 database connection, 5-7 ApJServBalance, 5-5 demand limiter, 1-6 ApJServManual, 5-5 demand rate, 1-5, 1-6 ApJServMount, 5-5 developer_mode, 5-9 ApJServRoute, 5-6 ApJServShmFile, 5-6 architecture ExtendedStatus, 2-4 JServ, 5-2 Oracle Internet Application Server 8i, 1-10 functional demand, 1-6 caching database connections, 5-9 SSL, 3-3...
  • Page 66 jserv.conf, 2-8 jserv.properties, 5-4 repository, defined, 5-3 JSP, 5-8 response time, 1-4 defined, 1-2 goal, 1-7 improving, 1-3 latency peak load, 1-8 defined, 1-2 sizing and, 3-2 first-request, 5-3 network, 3-1 load balancing, 5-4 load variances, 1-8 sar utility, 2-2 logging, 4-10 scalability defined, 1-2...
  • Page 67 think time defined, 1-2 resources and, 3-1 thread limit, 3-6 throughput defined, 1-2 demand limiter and, 1-6 increasing, 1-4 unit consumption, 1-6 uptime, 2-4 users, concurrent, 3-2 utilities sar, 2-2 wait time contention and, 1-4 defined, 1-2 parallel processing and, 1-4 zone, defined, 5-3 zone.properties, 5-7 Index-3...
  • Page 68 Index-4...

This manual is also suitable for:

Oracle9i application server

Table of Contents