Oracle OLTP (Transactional) Load Testing

Oracle OLTP (Transactional) Load Testing This guide gives you an introduction to conducting OLTP (Online Transaction Processing) workloads on the Oracle Database. This guide will equip you with the essentials
of 63
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Oracle OLTP (Transactional) Load Testing This guide gives you an introduction to conducting OLTP (Online Transaction Processing) workloads on the Oracle Database. This guide will equip you with the essentials for assessing the ability of any system that runs the Oracle Database for processing transactional workloads. On completion of this guide you will be able to run detailed and comprehensive Oracle load tests. After building a basic skill set, you should be able to take a system from 'bare metal' to generation of a full performance profile within one day. If you have not already done so you should read the Quick Start tutorial before proceeding with this guide. Note for Oracle on Windows Users If running Oracle workloads with Hammerora on Microsoft Windows (these issues DO NOT apply to Linux) it is essential to be aware of 2 known Oracle bugs: 1. It is mandatory to UPDATE YOUR SQLNET.ORA file on your Hammerora Windows client to disable the diagnosability infrastructure. 2. If running the 32-bit client on 64-bit windows Oracle bug # means you either need to apply a patch on both client and server or move the installation from the default directory. Please read the installation guide for instructions on how to make these changes before following the rest of this guide. Database load testing is an advanced skill and therefore familiarity with the Oracle Database and basic Oracle DBA skills are assumed. You should already be able to create, administer and connect to an Oracle database. If you do not have these skills I recommend start with an Introduction to Oracle. Introduction... 2 Single Threaded Tests... 2 What is TPC-C?... 3 Performance Profiles... 5 Test Network Configuration... 6 Load Generation Server Configuration... 7 SUT Database Server Configuration... 8 Administrator PC Configuration... 8 Installation and Configuration... 9 Load Generation Server Installation... 9 Load Generation Server Configuration SUT Database Server Installation Network Connectivity Creating the Test Schema Build Options Starting the Schema Build Pre-Testing and Planning Driver Options Loading the Driver Script Pre-Test 1 Verifying the Schema Pre-Test 2 Single and Multiple Virtual User Throughput Planning and Preparation Running Timed Tests with the AWR Snapshot Driver Script Automating Tests with Autopilot Mode Performance and Price Performance Analysis Conclusion Support and Discussion Introduction In this introduction we give an an overview of the correct approach to take for Oracle load testing and discuss the tests that Hammerora implements. Single Threaded Tests Historically user database performance tests were often conducted with simple scripts and using the time to completion for a simple select statement, function or Cartesian join as a prediction of CPU performance, for example: Connected to: Oracle Database 10g Express Edition Release Production SQL set timing on; SQL select count(*) from dba_objects; COUNT(*) Elapsed: 00:00:00.03 SQL select count(*) from dba_objects, dba_objects; COUNT(*) Elapsed: 00:00:40.86 The challenge was that such a statement runs as single-threaded and therefore was valid in the era of single-core processors to test the performance of one processor but became obsolete in the era of multicore processors. In other words with an example eight core processor such a test would give indications on the performance of one core and leave the other cores idle testing only a fraction of the performance potential of the CPU as a whole. Additionally such tests focused on CPU performance only without testing any of the storage component. Such a simple approach is flawed and to test a multiple CPU or multicore database environment requires a multithreaded test framework. Fortunately Hammerora is multi-threaded and therefore ready to test your multi-core environments with multiple virtual users all interacting independently with the database simultaneously. What is TPC-C? Designing and implementing a benchmark is a significant challenge. Many performance tests and tools experience difficulties in comparing system performance especially in the area of scalability, the ability of a test conducted on a certain system and schema size to be comparable with a test on a larger scale system. When system vendors wish to publish benchmark information about Oracle performance they have long had to access to such sophisticated test specifications to do so. In particular it can be noted that Oracle recognise the TPC-C as the standard for Online Transaction Processing, the type of workload we are looking to simulate. Fortunately the TPC benchmarks are industry standards. The TPC, at no charge, distributes its benchmark specifications to the public. For this reason Hammerora includes an implementation of the specification of the TPC-C benchmark that can be run in any Oracle environment. This implementation has the significant advantage that you know that the test is reliable, scalable and tested to produce consistent results. It is important to emphasise that the implementation is not a full specification TPC-C benchmark and the transaction results cannot be compared with the official published benchmarks in any way. Instead the implementations in Hammerora take the best designed specifications for a database transactional workload available in the world and enable you to run an accurate and repeatable workload against your own Oracle database. Audited TPC-C benchmarks are extremely costly and time consuming to establish and maintain, the Hammerora implementation of the TPC-C benchmarks is designed to capture the essence of TPC-C in a form that can be run at low cost bringing professional load testing to all Oracle environments. TPC-C implements a computer system to fulfil orders from customers to supply products from a company. The company sells 100,000 items and keeps its stock in warehouses. Each warehouse has 10 sales districts and each district serves 3000 customers. The customers call the company whose operators take the order, each order containing a number of items. Orders are usually satisfied from the local warehouse however a small number of items are not in stock at a particular point in time and are supplied by an alternative warehouse. Figure 1 shows this company structure. 3 Figure 1 TPC-C Company Structure It is important to note that the size of the company is not fixed and can add Warehouses and sales districts as the company grows. For this reason your test schema can be as small or large as you wish with a larger schema requiring a more powerful computer system to process the increased level of transactions. Figure 2 shows the TPC-C schema, in particular note how the number of rows in all of the tables apart from the ITEM table which is fixed is dependent upon the number of warehouses you choose to create your schema. 4 Figure 2 TPC-C Schema For additional clarity please note that the term Warehouse in the context of TPC-C bears no relation to a Data Warehousing workload, TPC-C defines a transactional based system and not a decision support (DSS) one. In addition to the computer system being used to place orders it also enables payment and delivery of orders and the ability to query the stock levels of warehouses. Consequently the workload is defined by a mix of 5 transactions as follows: New-order: receive a new order from a customer: 45% Payment: update the customers balance to record a payment: 43% Delivery: deliver orders asynchronously: 4% Order-status: retrieve the status of customer s most recent order: 4% Stock-level: return the status of the warehouse s inventory: 4% Performance Profiles For an official audited TPC-C benchmark the result of the tests is detailed as tpmc which represents the number of New Orders processed only. One particular advantage of Hammerora is is the ability to generate a performance profile as the load increases on your system. Whereas an official TPC-C benchmark gives you a single data-point and a typical single-threaded test (such as timing SQL Statements) also gives you a single data-point. Consider the graph shown in figure 3. 5 Transactions Example Performance Profile Users SYSTEM A SYSTEM B Figure 3 Performance Profile Example This graph shows the relative performance of real tests on different Oracle configurations. If observed as a single data point system A exhibits considerably higher performance then system B. However the performance profile clearly shows a crossover point. Represented by the steeper curve system B in fact shows higher performance up to the mid-point of the test whereas system A outperforms beyond this midpoint. This difference in performance highlights the differing attributes of performance and scalability, system B shows higher performance but system A shows better scalability. It should be clear that your testing goal should be to measure the performance profile of your system across all levels of utilisation. Test Network Configuration As shown in figure 4 the network architecture required for Hammerora is both simple and straightforward. You require the database server to be tested known as the system under test (SUT) installed and configured with the Oracle database. You also require a load generation server to run Hammerora installed with the Hammerora software and an Oracle client. Typically the administrator will monitor and manage the load testing from a separate notebook or PC. All systems will be connected across a network. Technically it is possible to run Hammerora on the SUT however this is not recommended. Firstly it makes it comparatively 6 harder to distinguish between the load generation server workload and the database workload. Secondly running the Hammerora workload will skew the results. By eliminating the network component of the workload results for a smaller number of virtual users will be comparatively higher however as the workload increases performance will be comparatively lower. To eliminate this skew in results a dedicated load generation server should be used. Figure 4 Hammerora Network Architecture Load Generation Server Configuration The most important component of the load generation server is the server processor. It is recommend to use an up to date multicore and multithreaded processor. Hammerora is a multithreaded application and implicitly benefits from a multicore server CPU such as the Intel Xeon 5XXX series range. To determine whether CPU capacity is sufficient for testing you can monitor the CPU utilisation with utilities such as top on Linux or Task Manager on Windows during testing. CPU utilisation reaching 100% is an indication that the CPU on the load generation server is limiting performance. It is important to note however that Hammerora is highly efficient and a high-performance multicore processor such as the Xeon 55XX and upwards will likely only see utilisation in the 10% range to drive a much larger database server to 100% utilisation. For the load generation memory requirement a rough guide is that Hammerora requires approximately 10MB for the application and 2MB per virtual user, for example 64 virtual users will need 138MB of memory. Again this represents a highly efficient load testing environment in comparison to commercial database load testing applications. Consequently it is it is entirely feasible to load test with a 32-bit x86 operating system on the load generation client with a 64-bit operating system only required 7 when conducting tests in excess of 1000 virtual users. For the load testing operating system, Hammerora is available pre-compiled for 32-bit Windows, 32-bit Linux and 64-bit Linux however you may compile the packages used for Hammerora manually for another operating system if you wish. Hammerora is a graphical application and therefore on Linux the operating system installation must include the X-windows packages. Storage requirements on the load generation server are minimal and all modern servers are likely to meet the storage required. Hammerora consumes approximately 15MB of disk space and you will also need an Oracle client. All Oracle database installations include an Oracle client, you therefore have the option of installing the oracle instant client, Oracle express edition or a full install of the Oracle Database software on the load generation server. Of course if the instant client or express edition is used the Oracle software will be license free. As an example build by installing Oracle Enterprise Linux operating system the oracle instant client and Hammerora for Linux 32 or 64 bit you can build a load generation server that is entirely license free. You should note that a load generation server built with Linux or Windows will be able to connect to and test an Oracle Database running on any operating system you choose. The load generation server does not need to be running the same version of Oracle. SUT Database Server Configuration The database server architecture to be tested must meet the standard requirements for an Oracle Database Server. Oracle can be installed on any supported operating system, there is no restriction on the version of Oracle that is required. To run a Hammerora transactional load test there are minimum requirements in memory and I/O (disk performance) to prevent these components being a bottleneck on performance. In turn the memory and I/O is determined by the capabilities of the CPUs installed. For a test schema that requires the minimal level of memory and I/O and therefore keying and thinking time is set to FALSE (keying and thinking time is detailed later in this guide) you should aim to create a schema with approximately a factor of 5 warehouses multiplied by the number of cores/threads (threads refers to Hyper Threads, so if a processor has 4 cores but supports 8 Hyper Threads then the value of 8 should be used) supported by system processor rounded up to the nearest 100. For example for a system with 64 threads, 64 * 5 = 320, rounded up to 400. A system with 24 threads would be configured with 200 warehouses. To calculate the disk storage required by your test schema allow a minimum of 100MB per warehouse plus 50% for additional growth. For the example system that supports 64 threads that would be 60GB of storage space. You should have sufficient memory to cache as much of your test schema in memory as possible without factoring in the additional storage for growth therefore for 64 threads a minimum memory requirement for the db_cache_size parameter would be 40GB. Reductions in memory will place more emphasis on the I/O performance. The database server should be connected to external storage typically in the form of a SAN or NAS. A database server without external storage will not sustain the level of I/O throughput necessary to conduct a load test. I recommend SSD disks to minimise the risk of I/O constraining performance and a RAID configuration of 8 SSD disks is a good minimum configuration. For hard disks a minimum configuration of 12 disk drives is recommended. Where possible RAID 0 should be used to maximise the potential performance of the disk drives available. If your I/O configuration does not meet minimum requirements it is worthwhile taking a moment to question whether to proceed with a performance test that will result in a conclusion that the storage is inadequate. For transactional tests I/O should be configured in particular to maximize sequential write performance to the redo logs, depending on the performance of your processors you should also allow for larger redo logs than normal. There is less emphasis on the storage performance of the datafiles provided that enough memory is available to cache the test schema and database checkpoints are not frequent during the test. It is worth reiterating that these guidelines define the minimum requirements for testing and you should aim for your SUT to exceed these minimum standards where possible. In particular where you are using keying and thinking times the number of virtual users required and the memory and I/O requirements will increase considerably. Administrator PC Configuration The administrator PC has the minimal requirement to display the graphical output from the load generation server. for example for a Linux load generation server the ability to display X windows. The PC should also 8 have the ability to connect to the SUT to collect AWR reports and monitor performance by the installation of an Oracle client. Installation and Configuration This sections describes the procedure to install and configure the Load Generation Server and the SUT Database Server. Load Generation Server Installation On the Load Generation Server refer to the dedicated Hammerora Installation Guide for details on installing Hammerora for your environment. Load Generation Server Configuration All of Hammerora s working data can be set using menu options. However if you wish in the Hammerora home directory there is a configuration file called config.xml that is read on startup. In this file you can preset your schema build and driver configurations by editing the xml file without having to change the data manually. If your xml file is well formed your variables will be applied to Hammerora when you selected the menu options. ?xml version= 1.0 encoding= utf-8 ? hammerora rdbms oracle /rdbms bm tpc-c /bm oracle service system_password manager /system_password instance oracle /instance /service tpcc schema count_ware 1 /count_ware num_threads 1 /num_threads tpcc_user tpcc /tpcc_user tpcc_pass tpcc /tpcc_pass tpcc_def_tab tpcctab /tpcc_def_tab tpcc_def_temp temp /tpcc_def_temp plsql 0 /plsql directory /directory /schema driver total_iterations 1000 /total_iterations raiseerror false /raiseerror keyandthink false /keyandthink checkpoint false /checkpoint oradriver standard /oradriver rampup 2 /rampup duration 5 /duration /driver /tpcc tpch schema 9 SUT Database Server Installation Installation and configuration of the Oracle Database on your chosen operating system is beyond the scope of this document. We recommend using one of the many tutorials available on the web for example: You should have the Oracle database software installed and a test database created and running. During the installation make a note of your system user password, you will need it for the test schema creation. You may at your discretion use an existing database however please note that Hammerora load testing can drive your system utilization to maximum levels and therefore testing an active production system is not recommended. When your database server is installed you should create a tablespace into which the test data will be installed allowing disk space according to the guide previously in this document. For example the following shows creating the tablespace in the ASM disk group DATA: sqlplus / as sysdba SQL create tablespace tpcctab datafile '+DATA' size 24g extent management local segment space management auto; You can add additional datafiles to your tablespace as follows: SQL alter tablespace tpcctab add datafile '+DATA' size 24g; Network Connectivity You must be able to connect from your load generation server to your SUT database server across the network using Oracle TNS. This will involve successful configuration of your listener on the SUT database server and the tnsnames.ora file on the load generation server. You can troubleshoot connectivity issues using the ping, tnsping and sqlplus commands on the load generation client and the lsnrctl command on the SUT database server. For example a successful tnsping test looks as follows: tnsping DEV TNS Ping Utility for 32-bit Windows: Version Production Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter files: D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTI
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks