background image

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

Summary of Contents for Oracle9i Application Server

Page 1: ...pplication 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: ...ncluding documentation shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement Otherwise Programs delivered subject to the Federal Acquisition Regulations are restricted computer software and use duplication and disclosure of the Programs shall be subject to the restrictions in FAR 52 227 19 Commercial Computer Software Restricted Rights June 1987 Oracle...

Page 3: ...l 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 ...

Page 4: ... 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 Connect...

Page 5: ...sing 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 6: ...vi ...

Page 7: ...nformation 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 R...

Page 8: ...viii ...

Page 9: ...fies 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 original source All of our in house tests were run on a dedicated 100 Mbps network in order to achieve repeatable test results Your results will vary based on network configuration and contention characteristics C...

Page 10: ...e you call You will also need your CSI number if applicable or complete contact details including any special project information 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 i...

Page 11: ... 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 d...

Page 12: ...xii ...

Page 13: ...sses 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 ...

Page 14: ...or 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 response time The time between the submission of a request and the completion of the response scalability The ability of a system to provide throughput in proportion to and limited only by available ha...

Page 15: ...e in this area by Reducing wait time Reducing service time Figure 1 1 illustrates ten independent tasks competing 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 ...

Page 16: ...ime 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 mus...

Page 17: ...ance 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 To manage this situation you have two options Limit demand rate to maintain...

Page 18: ...he possible demands that may be placed on the system and design the application or configure the system with these constraints 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 Th...

Page 19: ...efined 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 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...

Page 20: ...at 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 will 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 0...

Page 21: ...s 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 ...

Page 22: ... Oracle9i Application Server This guide addresses the performance and configuration of these components 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 ...

Page 23: ...er 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 ...

Page 24: ...ive activity counters in the operating system at specified intervals Report CPU Utilization To determine process use use the following sar command sar u 5 5 This command samples CPU usage five times in five second intervals as shown below sar u 5 5 15 30 25 usr sys wio idle 15 30 30 49 36 0 14 15 30 35 52 41 0 7 15 30 40 46 45 0 8 15 30 45 46 44 0 10 15 30 50 50 41 0 9 Average 46 41 0 9 The statis...

Page 25: ...R 0 24 9 0 6 0 05 oraweb 20936 rkonanga 5 0 1252 1252 916 R 0 1 4 0 0 0 00 top 15187 oasport 0 0 2232 2232 1372 S 0 0 4 0 1 0 02 xterm 20728 oasport 0 0 2984 2984 1604 S 0 0 1 0 1 0 00 oasoorb 1 root 0 0 156 136 92 S 0 0 0 0 0 0 04 init 2 root 0 0 0 0 0 SW 0 0 0 0 0 0 10 kflushd 3 root 0 0 0 0 0 SW 0 0 0 0 0 6 35 kupdate Monitoring the Web Server Monitoring is essential to performance tuning The O...

Page 26: ...ide of your domain but be aware of the security implications of this your server status is accessible from any site It is probably best to specify the domain s from which you want to monitor your system With monitoring enabled you can view current statistics from http hostname port server status These statistics help you to gain insight on how busy your system is The display includes Hostname for ...

Page 27: ...f 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 If your system has poor response times or you suspect that httpd processes have stopped responding look at the Req request column It shows the number of milliseconds required to process the most recent request Check to see if this number is greate...

Page 28: ... display Figure 2 1 is a snapshot of a server for a moment in time You can get updated server statistics at any interval you choose by including the refresh parameter in the server status URL http servername port server status refresh x where x is an integer representing the number of seconds after which the data is refreshed For example specify refresh 3 to update statistics every 3 seconds You m...

Page 29: ...fy which process is not responding For more information on mod_status see http www oreillynet com pub a apache 2000 04 21 wrangler html http www apache org docs mod mod_status html Table 2 2 Log status script variables Variable Value wherelog The pathname of the log file location for example private admin logs The script creates a file name such as 20010945 port Port number of the server to monito...

Page 30: ... jserv status order deny allow deny from all allow from oracle com Location 2 Type the following into your browser http hostname port jserv The port must be the port on which the web server listens found in the httpd conf file Always include the trailing slash in this URL A not found error occurs if you omit the trailing slash A Configured Hosts column displays links to hosts 3 Click the host to m...

Page 31: ...Monitoring JServ Processes Monitoring Your Web Server 2 9 Figure 2 3 JServ status display The Status column shows the current shared memory shm state of each process ...

Page 32: ...s Note The Status column is populated only for processes that are started in manual mode It is not populated for a single process started in automatic mode Symbol Meaning The process is running The process is stopped X The process was terminated in a harsh shutdown The process was terminated in a graceful shutdown existing requests were handled before the process was terminated ...

Page 33: ... your hardware resources need to be adequate for the requirements of your specific applications To avoid hardware related performance bottlenecks each hardware component should operate at no more than 80 of capacity See Using the sar Utility AIX HP UX Intel Solaris on page 2 2 for information on measuring CPU utilization Processor and memory resources in particular should be allocated generously f...

Page 34: ...le 3 1 Concurrent executing users User population1 1 User population total users Think time sec 2 2 Think time the time the user is not engaged in actual use of the processor the time between requests Service time sec 3 3 Service time seconds elapsed time to complete the operation measured for a single user Range of concurrent users4 4 Range of concurrent users the number of users measured on the ...

Page 35: ...in terms of response time and CPU utilization For example a request with a response time of 0 5 seconds without SSL generated a response time of 1 7 seconds with SSL measured on an internal 100 Mbps network Most of the performance cost in using SSL is in establishing the connection approximately 125 ms of CPU time per connection on a 336 Mhz processor The high connection cost is incurred for the f...

Page 36: ...are and software documentation for more information on measuring and tuning operating system memory usage You can monitor memory usage and processor statistics with standard operating system tools See Chapter 2 Monitoring Your Web Server for more information HTTP Server Memory Requirements In a series of tests of listener memory usage each HTTP listener used at startup approximately 400K of reside...

Page 37: ...ess When a JServ process exceeds its maximum heap size the process terminates In automatic mode a new process is started but performance is degraded significantly In manual mode a terminated process will not be restarted so ensure that the heap size is sufficient Servlet and OracleJSP pages Memory Requirements OracleJSP pages Oracle s implementation of Sun s JavaServer Pages and servlets require d...

Page 38: ...e recommends about 2 JServ processes per CPU as a starting point The default thread setting security maxConnections 50 in the JServ configuration file is also a good starting point See Load Balancing on page 5 4 for instructions on changing parameters in the configuration files If your application code performs a lot of synchronization or creates many new Java objects then you should consider incr...

Page 39: ...Determining Memory Requirements Sizing and Configuration 3 7 Figure 3 1 Request distribution ...

Page 40: ...Determining Memory Requirements 3 8 Oracle HTTP Server powered by Apache Performance Guide ...

Page 41: ...is 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 ...

Page 42: ...Speed on page 4 6 tcp_close_wait_interval 60000 Parameter name in Solaris 2 6 See Specifying Retention time for Connection Table entries on page 4 7 tcp_time_wait_interval 60000 Parameter name in Solaris 2 7 See Specifying Retention time for Connection Table entries on page 4 7 tcp_conn_req_max_q 1024 See Increasing the Handshake Queue Length on page 4 7 tcp_conn_req_max_q0 1024 See Increasing the...

Page 43: ...it_interval_max ndd dev tcp 60 000 60 000 tcp_rexmit_interval_min ndd dev tcp 500 500 tcp_xmit_hiwater_def ndd dev tcp 32 768 32 768 tcp_recv_hiwater_def ndd dev tcp 32 768 32 768 Table 4 3 Tru64 TCP IP Tunables Parameter Module Default value Tuned Value tcbhashsize sysconfig r inet 512 16 384 tcbhashnum sysconfig r inet 1 16 as of 5 0 tcp_keepalive_default sysconfig r inet 0 1 tcp_sendspace sysco...

Page 44: ...nd Maximum Size Edit the files listed below to change kernel values Table 4 4 AIX TCP Parameters using no command Parameter Model Default Value Recommended Value rfc1323 etc rc net 0 1 sb_max etc rc net 65 536 1 31 072 tcp_mssdflt etc rc net 512 1 024 ipqmaxlen etc rc net 50 100 tcp_sendspace etc rc net 16 384 65 536 tcp_recvspace etc rc net 16 384 65 536 xmt_que_size etc rc net 30 150 See Also Tu...

Page 45: ...e define SK_WMEM_MAX 32767 define SK_RMEM_MAX 32767 endif You can change the MAX WINDOW value in the Linux kernel source directory LINUX SOURCE DIR include net tcp h define MAX_WINDOW 32767 define MIN_WINDOW 2048 The MIN_WINDOW definition limits you to using only 15bits of the window field in the TCP packet header For example if you use a 40kB window set the rmem_default to 40kB The stack will rec...

Page 46: ...ould increase the hash size for the TCP connection table The hash size is the number of hash buckets used to store the connection data If the buckets are very full it takes more time to find a connection Increasing the hash size will reduce the connection lookup time but increases memory consumption Suppose your system performs 100 connections per second On Intel Solaris if you set tcp_close_wait_...

Page 47: ...ait_interval 60000 On Solaris 2 7 and HP UX prompt usr sbin ndd set dev tcp tcp_time_wait_interval 60000 Increasing the Handshake Queue Length During the TCP connection handshake the server after receiving a request SYN from a client sends a reply and waits to hear back from the client The client responds to the server s message and the handshake is complete Upon receiving the first request from t...

Page 48: ...a transfer to prevent overloading a busy segment of the Internet With slow start one packet is sent an acknowledgment is received then two packets are sent The number sent to the server continues to be doubled after each acknowledgment until the TCP transfer window limits are reached Some versions of Microsoft Windows including NT 4 0 and 95 do not acknowledge receipt of a single packet when a con...

Page 49: ...rsion the maximum was 256 The default is 150 which should be adequate for most uses If the MaxClients setting is too low and the limit is reached clients will be unable to connect Increasing MaxClients when system resources are saturated does not improve performance When there are no httpd processes available connection requests are queued in the TCP IP system until a process becomes available and...

Page 50: ...ion is the ORACLE_HOME Apache Apache logs directory The file can be used by multiple Oracle HTTP Server processes The duration of an SSL session is unrelated to the use of HTTP persistent connections Impact of Logging This section discusses types of logging log levels and the performance implications for using them Access Logging For static page requests access logging of the default fields result...

Page 51: ...till uses HTTP 1 0 with some 1 1 features such as persistent connections Internet Explorer uses HTTP 1 1 The performance benefit of persistent connections comes from reducing the overhead of repeatedly establishing and tearing down connections one per request A persistent connection accepts multiple requests from a user For a small static page request the connection latency can equal or exceed the...

Page 52: ...e a web page with three images from the server With persistent connections the response time for the same request is reduced Activity Seconds Establish connection 1 Produce and send the text portion of the page 5 Establish connection 1 Transfer first image file 2 Establish connection 1 Transfer second image file 2 Establish connection 1 Transfer third image file 2 Total 15 Activity Seconds Establi...

Page 53: ...nificant period of time the amount of time depends on your KeepAlive settings If you have a large user population and you set your KeepAlive limits too high clients could be turned away because of insufficient httpd deamons The default settings for the KeepAlive directives are KeepAlive on MaxKeepAliveRequests 100 KeepAliveTimeOut 15 These settings allow enough requests per connection and time bet...

Page 54: ...ection 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 If a connection is left in the FIN_WAIT_2 state the httpd process with which the connection is associated is freed to service other requests as indicated so this problem won t tie up web server processes Apache Versions The difference between Apache versions ...

Page 55: ...itecture 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 ...

Page 56: ...cess mod_jserv which is implemented in C functions as a dispatcher routing each servlet request to a JServ process for execution The servlet engine runs in its own JVM and is solely responsible for parsing the request and generating a response As Figure 5 1 shows multiple JServs can service requests The HTTP server process and the JServ process communicate using the Apache JServ Protocol 1 2 Figur...

Page 57: ...SP as the servlet your code does not extend HttpServlet you will be unable to use this pre load option but you could pre load the JSP runner by including the oracle jsp jspServlet in servlets startup If the first request latency for your initialization routines is really a performance issue you can achieve some of the results described above by creating a dummy servlet to call your one time initia...

Page 58: ...n port numbers and directory locations where needed If you use load balancing you must start and stop processes manually because JServ cannot automatically start and stop more than one JServ process Sample scripts for starting and stopping the JServ processes and the Oracle HTTP Server are included in the ORACLE_HOME Apache Apache bin directory This means that if a process terminates for any reaso...

Page 59: ...l on 2 Indicate where the servlet request is to be sent a Locate the ApJServMount directive ApJServMount servlets root If the user requests http your server com servlets testServlet the ApJServMount directive above will execute testServlet in the zone called root b Change the zone identifier from root to balance set root and then add the directives needed to describe the processes sharing the load...

Page 60: ...ions JServ uses this information to keep all of a session s requests together in one process The JServ session mechanism sends the process route information back to the user generally in a cookie You need only modify it if your application uses sessions The ApJServShmFile directive specifies a shared memory file that the httpd processes may use to track the state of the JServ processes Distributio...

Page 61: ...d with obtaining a database connection Alternatively you can use JDBC connection caching There are three parameters in the zone properties file that impact the performance of STM servlets in particular These govern The minimum number of servlet object instances that will be generated and available after the servlet class is loaded The maximum number that can be generated The number that should be ...

Page 62: ...ead they consume about 0 5 KB of resident memory You must turn off sessions if you do not want a new session to be created with each request By default sessions are enabled in OracleJSPs so if they are not being used turn them off by including the following line at the top of the page page session false If you are going to use sessions ensure that you explicitly close them If you don t they will l...

Page 63: ... throughput and 28 in average response time Buffering If an OracleJSP page is not using any features that do not require resetting the buffer such as error pages contextType settings forwards etc disabling the JSP page buffer will improve performance This is because memory will not be used in creating the buffer and the output can go directly to the browser Use this page directive to disable buffe...

Page 64: ...e often This is not as beneficial for large data sets since they consume more memory Using static includes To invoke static includes use the page directive include file jsp filename jsp Static include creates a copy of the file in the JSP thereby affecting its page size This is useful in avoiding trips to the request dispatcher unlike dynamic includes which must go through the request dispatcher e...

Page 65: ...rs 3 2 concurrent users 3 2 4 8 MaxClients and 3 2 connection caching 5 7 contention 1 4 CPU insufficient 1 4 statistics 2 2 usage 2 2 cron 2 7 D database connection 5 7 demand limiter 1 6 demand rate 1 5 1 6 developer_mode 5 9 E ExtendedStatus 2 4 F functional demand 1 6 G graceful shutdown 2 10 H harsh shutdown 2 10 J JDBC 5 7 JServ described 5 2 load balancing 5 4 process start up time 5 3 proc...

Page 66: ...7 3 1 protocol Apache JServ 1 2 5 2 HTTP 1 1 4 11 SSL 3 3 R repository defined 5 3 response time 1 4 defined 1 2 goal 1 7 improving 1 3 peak load 1 8 sizing and 3 2 S sar utility 2 2 scalability defined 1 2 monitoring 2 2 security allowedAddresses 5 5 security maxConnections 3 6 server statistics 2 4 server side status information 2 3 server status 2 4 service time 1 3 defined 1 2 servlet database...

Page 67: ...ad limit 3 6 throughput defined 1 2 demand limiter and 1 6 increasing 1 4 U unit consumption 1 6 uptime 2 4 users concurrent 3 2 utilities sar 2 2 W wait time contention and 1 4 defined 1 2 parallel processing and 1 4 Z zone defined 5 3 zone properties 5 7 ...

Page 68: ...Index 4 ...

Reviews: