IBM Informix Performance Guide
Total Page:16
File Type:pdf, Size:1020Kb
IBM Informix Version 11.70 IBM Informix Performance Guide SC27-3544-00 IBM Informix Version 11.70 IBM Informix Performance Guide SC27-3544-00 Note Before using this information and the product it supports, read the information in “Notices” on page C-1. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright IBM Corporation 1996, 2010. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Introduction .................................xiii About this publication ...............................xiii Topics beyond the scope of this publication .......................xiii Types of users .................................xiv Software dependencies ..............................xiv Assumptions about your locale ...........................xiv Demonstration databases .............................xiv What's new in performance for Informix, version 11.70 .....................xv Example code conventions ..............................xvii Additional documentation..............................xviii Compliance with industry standards ..........................xviii Chapter 1. Performance basics .........................1-1 Developing a basic approach to performance measurement and tuning ...............1-1 Quick start for acceptable performance on a small database ...................1-2 Performance goals .................................1-2 Measurements of performance .............................1-3 Throughput ..................................1-3 Response time .................................1-5 Cost per transaction ...............................1-7 Resource utilization and performance ..........................1-7 Resource utilization ...............................1-8 CPU utilization .................................1-9 Memory utilization ...............................1-10 Disk utilization ................................1-11 Factors that affect resource utilization ..........................1-12 Maintenance of good performance ...........................1-14 Chapter 2. Performance monitoring and the tools you use .............2-1 Evaluate the current configuration ...........................2-1 Create a performance history .............................2-1 The importance of a performance history ........................2-2 Tools that create a performance history .........................2-2 Monitor database server resources ...........................2-6 Monitor resources that impact CPU utilization ......................2-7 Monitor memory utilization.............................2-8 Monitor disk I/O utilization ............................2-10 Monitor transactions................................2-12 Using the onlog utility to monitor transactions ......................2-12 Using the onstat utility to monitor transactions ......................2-13 Using ISA to monitor transactions ..........................2-13 Monitor sessions and queries .............................2-13 Monitoring memory usage for each session .......................2-14 Using the SET EXPLAIN statement ..........................2-14 Chapter 3. Effect of configuration on CPU utilization................3-1 UNIX configuration parameters that affect CPU utilization ...................3-1 UNIX semaphore parameters ............................3-1 UNIX file-descriptor parameters ...........................3-2 UNIX memory configuration parameters ........................3-3 Windows configuration parameters that affect CPU utilization ..................3-3 Configuration parameters and environment variables that affect CPU utilization ............3-3 Specifying virtual processor class information.......................3-4 Setting the MULTIPROCESSOR configuration parameter when using multiple CPU VPs ........3-9 Setting the SINGLE_CPU_VP configuration parameter when using one CPU VP...........3-10 © Copyright IBM Corp. 1996, 2010 iii Optimizing access methods ............................3-10 Limiting PDQ resources in queries ..........................3-11 Limiting the performance impact of CPU-intensive queries ..................3-11 Limiting the number of PDQ scan threads that can run concurrently ..............3-12 Configuring poll threads .............................3-12 Enabling fast polling...............................3-15 Network buffer pools ...............................3-15 Network buffers ................................3-16 Support for private network buffers .........................3-16 Network buffer size ...............................3-17 Virtual processors and CPU utilization..........................3-18 Adding virtual processors .............................3-18 Automatic addition of CPU virtual processors ......................3-18 Monitoring virtual processors............................3-19 CPU virtual processor memory caches .........................3-22 Connections and CPU utilization ...........................3-23 Multiplexed connections and CPU utilization ......................3-23 MaxConnect for multiple connections (UNIX) ......................3-24 Chapter 4. Effect of configuration on memory utilization ..............4-1 Shared memory..................................4-1 Resident portion of shared memory ..........................4-2 Virtual portion of shared memory ..........................4-2 Message portion of shared memory ..........................4-3 Estimating the size of the resident portion of shared memory .................4-3 Estimating the size of the virtual portion of shared memory ..................4-4 Estimating the size of the message portion of shared memory .................4-6 Configuring UNIX shared memory ..........................4-6 Freeing shared memory with onmode -F ........................4-7 Configuration parameters that affect memory utilization ....................4-7 Setting the size of the buffer pool, logical-log buffer, and physical-log buffer ............4-8 The LOCKS configuration parameter and memory utilization .................4-16 The RESIDENT configuration parameter and memory utilization ................4-17 The SHMADD and EXTSHMADD configuration parameters and memory utilization .........4-18 The SHMTOTAL configuration parameter and memory utilization ...............4-18 The SHMVIRTSIZE configuration parameter and memory utilization ..............4-19 The SHMVIRT_ALLOCSEG configuration parameter and memory utilization............4-19 The STACKSIZE configuration parameter and memory utilization ...............4-20 Configuration parameters that affect memory caches .....................4-21 Data-dictionary cache ..............................4-21 Data-distribution cache ..............................4-23 SQL statement cache................................4-27 Prepared statements and the statement cache ......................4-27 SQL statement cache configuration ..........................4-28 Monitoring and tuning the SQL statement cache .....................4-29 UDR cache ...................................4-39 Session memory .................................4-40 Data-replication buffers and memory utilization ......................4-41 Memory latches .................................4-41 Monitoring latches with command-line utilities ......................4-41 Monitoring latches with ISA ............................4-42 Monitoring latches with SMI tables ..........................4-42 Encrypted values .................................4-42 Chapter 5. Effect of configuration on I/O activity .................5-1 Chunk and dbspace configuration ...........................5-1 Associate disk partitions with chunks .........................5-2 Associate dbspaces with chunks ...........................5-2 Placing system catalog tables with database tables .....................5-2 I/O for cooked files for dbspace chunks .........................5-2 iv IBM Informix Performance Guide Direct I/O (UNIX) ................................5-3 Direct I/O (Windows) ..............................5-3 Concurrent I/O (AIX only) .............................5-3 Enabling the direct I/O or concurrent I/O option (UNIX)...................5-4 Confirming the use of the direct or concurrent I/O option (UNIX)................5-4 Placement of critical data ..............................5-5 Consider separate disks for critical data components ....................5-5 Consider mirroring for critical data components ......................5-5 Configuration parameters that affect critical data ......................5-7 Configure dbspaces for temporary tables and sort files.....................5-8 Creating temporary dbspaces ............................5-10 DBSPACETEMP configuration parameter ........................5-10 DBSPACETEMP environment variable .........................5-10 Estimating temporary space for dbspaces and hash joins...................5-11 PSORT_NPROCS environment variable ........................5-12 Configure sbspaces for temporary smart large objects.....................5-12 Creating temporary sbspaces ............................5-13 SBSPACETEMP configuration parameter ........................5-14 Placement