Swingbench character mode pressure measurement best practices

Source: Internet
Author: User
Tags benchmark dba


Previously, the use of swingbench for the performance stress test of Oracle RAC DB was used in the most basic and intuitive graphical mode to meet most requirements.



However, in some scenarios, the graphics mode may itself consume too much resources, especially when generating a large amount of test data, it is likely due to the instability of the graphics itself caused by the death of the card or even direct exit, seriously affecting the efficiency and testing experience.
In the case of silent mode, the direct use of XML editing is not a good way to confirm the correct change.
This article mainly introduces the little tricks I found when I was doing a stress test.


    • 1. Generate Pressure measurement data
    • 2. Perform stress tests
1. Generate Pressure measurement data


Before using the graphical interface, we went directly to execute./oewizard can invoke the graphical interface to configure the final generation of the data for the stress test in the prompt step-by-step configuration.



In the case of character mode, you need to specify the parameter configuration file and some necessary parameters to see what parameters are available first:


[oracle@db50 bin]$ ./oewizard -h
usage: parameters:
 -allindexes             build all indexes for schema
 -bigfile                use big file tablespaces
 -c <filename>           wizard config file
 -cl                     run in character mode
 -compositepart          use a composite paritioning model if it exisits
 -compress               use default compression model if it exists
 -create                 create benchmarks schema
 -cs <connectString>     connectring for database
 -dba <username>         dba username for schema creation
 -dbap <password>        password for schema creation
 -debug                  turn on debugging output
 -debugf                 turn on debugging output to file (debug.log)
 -df <datafile>          datafile name used to create schema in
 -drop                   drop benchmarks schema
 -dt <driverType>        driver type (oci|thin)
 -g                      run in graphical mode (default)
 -generate               generate data for benchmark if available
 -h,--help               print this message
 -hashpart               use hash paritioning model if it exists
 -hcccompress            use HCC compression if it exisits
 -nocompress             don't use any database compression
 -noindexes              don't build any indexes for schema
 -nopart                 don't use any database partitioning
 -normalfile             use normal file tablespaces
 -oltpcompress           use OLTP compression if it exisits
 -p <password>           password for benchmark schema
 -part                   use default paritioning model if it exists
 -pkindexes              only create primary keys for schema
 -rangepart              use a range paritioning model if it exisits
 -s                      run in silent mode
 -scale <scale>          mulitiplier for default config
 -sp <soft partitions>   the number of softparitions used. Defaults to cpu
                         count
 -tc <thread count>      the number of threads(parallelism) used to
                         generate data. Defaults to cpus*2
 -ts <tablespace>        tablespace to create schema in
 -u <username>           username for benchmark schema
 -v                      run in verbose mode when running from command
                         line
 -version <version>      version of the benchmark to run
[oracle@db50 bin]$


Actually I test here, the parameters used are-CL,-create,-C,-scale,-TC,-part
Where-CL,-create is required;-C is to specify an XML configuration file,-scale refers to the amount of pure data (is the default 1G configuration of how many times),-TC refers to the degree of parallelism,-part refers to the partition.



./oewizard -cl -create -c oewizard.xml -scale 150 -tc 64 -part


And about oewizard.xml This configuration file, I only changed the following part of the content, the others remain unchanged:



<DefaultParameters>
   <Parameter Key="datatablespacesexists" Value="true"/>
   <Parameter Key="password" Value="soe"/>
   <Parameter Key="username" Value="soe"/>
   <Parameter Key="datafile" Value="+DATA"/>
   <Parameter Key="userexists" Value="true"/>
   <Parameter Key="connectionstring" Value="//db50/jyzhao"/>
   <Parameter Key="connectiontype" Value="thin"/>
   <Parameter Key="onlydropuser" Value="false"/>
   <Parameter Key="operation" Value="create"/>
   <Parameter Key="tablespace" Value="SOE"/>
   <Parameter Key="dbausername" Value="sys as sysdba"/>
   <Parameter Key="dbapassword" Value="oracle"/>
   <Parameter Key="output" Value="Verbose"/>
</DefaultParameters>


The main thing is to confirm the test user and password, as well as the creation location of the data file, database connection string, database sys user and password these items.
The trick is that if you do not confirm that your profile is written correctly, you can do this first, bring in the corresponding parameters, call the graph to go through the check under all configurations:



./oewizard -c oewizard.xml -scale 150 -tc 64 -part


After confirming the error, I am here because the amount of data generated is very large, the bare data is 150G, which is not counted. So take the background execution and record a time before and after execution:



--1. Generate pressure test data script
$ cat test150.sh
date
echo "===== Begin ====="
./oewizard -cl -create -c oewizard.xml -scale 150 -tc 64 -part
echo "===== End ====="
date

--2. Background execution, output log
nohup sh test150.sh> test150.log &

--3. Trace log output
tail -20f test150.log


It took nearly 4 hours to complete the final generation:


[oracle@yzdb1 bin]$ tail -20f test150.log 
Fri Aug 31 10:52:54 CST 2018
=====Begin=====
SwingBench Wizard
Author  :        Dominic Giles
Version :        2.5.0.971

Running in Lights Out Mode using config file : oewizard.xml

============================================
|           Datagenerator Run Stats        |
============================================
Connection Time                        0:00:00.005
Data Generation Time                   3:41:44.395
DDL Creation Time                      0:09:00.405
Total Run Time                         3:50:44.809
Rows Inserted per sec                      136,446
Data Generated (MB) per sec                   10.9
Actual Rows Generated                1,816,220,694


Post Creation Validation Report
===============================
The schema appears to have been created successfully.

Valid Objects
=============
Valid Tables : 'ORDERS','ORDER_ITEMS','CUSTOMERS','WAREHOUSES','ORDERENTRY_METADATA','INVENTORIES','PRODUCT_INFORMATION','PRODUCT_DESCRIPTIONS','ADDRESSES','CARD_DETAILS'
Valid Indexes : 'PRD_DESC_PK','PROD_NAME_IX','PRODUCT_INFORMATION_PK','PROD_SUPPLIER_IX','PROD_CATEGORY_IX','INVENTORY_PK','INV_PRODUCT_IX','INV_WAREHOUSE_IX','ORDER_PK','ORD_SALES_REP_IX','ORD_CUSTOMER_IX','ORD_ORDER_DATE_IX','ORD_WAREHOUSE_IX','ORDER_ITEMS_PK','ITEM_ORDER_IX','ITEM_PRODUCT_IX','WAREHOUSES_PK','WHS_LOCATION_IX','CUSTOMERS_PK','CUST_EMAIL_IX','CUST_ACCOUNT_MANAGER_IX','CUST_FUNC_LOWER_NAME_IX','ADDRESS_PK','ADDRESS_CUST_IX','CARD_DETAILS_PK','CARDDETAILS_CUST_IX'
Valid Views : 'PRODUCTS','PRODUCT_PRICES'
Valid Sequences : 'CUSTOMER_SEQ','ORDERS_SEQ','ADDRESS_SEQ','LOGON_SEQ','CARD_DETAILS_SEQ'
Valid Code : 'ORDERENTRY'
Schema Created
=====End=====
Fri Aug 31 14:43:42 CST 2018


It turns out that I added this time at the beginning and end of the execution, some superfluous, and the software has statistics total Run times.


2. Perform stress tests


Using graphical mode, it is directly executed./swingbench then after the configuration is completed, the stress test can directly display the following results:

If you use a character, you need to call the./charbench, valid parameters are as follows:


[oracle@db50 bin]$ ./charbench -h
usage: parameters:
 -D <variable=value>           use value for given environment variable
 -a                            run automatically
 -be <stopafter>               end recording statistics after. Value is in
                               the form hh:mm
 -bg                           indicate that charbench will be run in the
                               background
 -bs <startafter>              start recording statistics after. Value is
                               in the form hh:mm
 -c <filename>                 specify config file
 -co <hostname>                specify/override coordinator in
                               configuration file.
 -com <comment>                specify comment for this benchmark run (in
                               double quotes)
 -cpuloc <hostname >           specify/overide location/hostname of the
                               cpu monitor.
 -cpupass                      specify/overide os password of the user
                               used to monitor cpu.
 -cpuuser                      specify/overide os username of the user
                               used to monitor cpu.
 -cs <connectstring>           override connect string in configuration
                               file
 -debug                        turn on debugging. Written to standard out
 -debugf                       turn on debugging. Witten to debug.log.
 -debugfine                    turn on finest level of debugging
 -di <shortname(s)>            disable transactions(s) by short name,
                               comma separated
 -dt <drivertype>              override driver type in configuration file
                               (thin, oci, ttdirect, ttclient)
 -dumptx                       output transaction response times to file
 -dumptxdir <directory name>   directory for transaction response times
                               files
 -en <shortname(s)>            enable transactions(s) by short name, comma
                               separated
 -env                          display environment configuration
 -f                            force data collection and run termination
                               regardless of state
 -g <groupID>                  distributed group identifier
 -h,--help                     print this message
 -i                            run interactively (default)
 -intermax <milliseconds>      override minimum inter transaction sleep
                               time (default = 0)
 -intermin <milliseconds>      override minimum inter transaction sleep
                               time (default = 0)
 -ld <milliseconds>            specify/overide the logon delay
                               (milliseconds)
 -max <milliseconds>           override maximum intra transaction think
                               time in configuration file
 -min <milliseconds>           override minimum intra transaction think
                               time in configuration file
 -p <password>                 override password in configuration file
 -r <filename>                 specify results file
 -rr                           specify/overide refresh rate for charts in
                               secs
 -rt <runtime>                 specify/overide run time for the benchmark.
                               Value is in the form hh:mm
 -s                            run silent
 -stats <stats level>          specify level result stats detail (full or
                               simple)
 -u <username>                 override username in configuration file
 -uc <user count>              override user count in configuration file.
 -v <options>                  display run statistics (vmstat/sar like
                               output), options include (comma separated no spaces).
                               trans|cpu|disk|dml|errs|tpm|tps|users|resp|vresp
 -vo <verboseOutput>           output file for verbose output (defaults to
                               stdout)
[oracle@db50 bin]$


And the most important XML configuration file if manual editing is a very distressing thing, the same technique, the graphical call after the configuration of the parameters and then save as export an XML configuration. 
 For example, the exported XML configuration file is a simulated 2000 concurrent OLTP type business, the file name is Oltp2000.xml 
 so the character test can be called directly:


-Simply look at the amount of things
[oracle @ db50 bin] $ ./charbench -c oltp2000.xml

-Specify the login information of one of the machines, and see the CPU and I / O load of the machine, and the response time
[oracle @ db50 bin] $ ./charbench -c oltp2000.xml -cpuloc db50 -cpuuser oracle -cpupass oracle -v 'users, cpu, disk, tpm, tps, resp'> oltp2000_load50.log
[oracle @ db50 bin] $ ./charbench -c oltp2000.xml -cpuloc db52 -cpuuser oracle -cpupass oracle -v 'users, cpu, disk, tpm, tps, resp'> oltp2000_load52.log

--The data of quasi-production was not retained at that time. Here I will use the data of my experimental environment (50 concurrent) to briefly explain:
[oracle @ db50 bin] $ tail -20f oltp2000_load50.log
Author: Dominic Giles
Version: 2.5.0.971

Results will be written to results.xml.
Hit Return to Terminate Run ...

Time Users User System Wait Idle Bi Bo TPM TPS Response
23:19:30 [0/50] 0 0 0 0 0 0 0 0 0 0
23:19:33 [0/50] 0 0 0 0 0 0 0 0 0
23:19:34 [0/50] 11 22 2 65 19 2194 0 0 0
23:19:35 [0/50] 27 44 0 28 155 1514 0 0 0
23:19:36 [0/50] 8 24 1 67 31 1593 0 0 0
23:19:37 [12/50] 5 27 2 65 56 2626 0 0 0
23:19:38 [35/50] 6 11 1 82 39 1152 0 0 0
23:19:39 [50/50] 8 20 2 71 23 2802 0 0 0
23:19:40 [50/50] 16 33 0 51 820 1218 43 43 233
23:19:41 [50/50] 26 73 1 0 1780 580 161 118 390
23:19:42 [50/50] 45 54 1 0 1833 658 264 103 393
23:19:43 [50/50] 36 63 1 0 1959 655 384 120 361
23:19:44 [50/50] 25 75 0 0 1999 703 487 103 366
23:19:45 [50/50] 33 66 1 0 1611 588 563 76 380
23:19:46 [50/50] 46 53 1 0 1727 724 650 87 384
23:19:47 [50/50] 35 64 1 0 1607 694 766 116 376
23:19:48 [50/50] 30 69 1 0 1587 596 852 86 382
23:19:49 [50/50] 31 68 1 0 2227 629 945 93 380
23:19:50 [50/50] 46 54 0 0 2611 689 1034 89 385
23:19:51 [50/50] 35 64 1 0 1763 626 1127 93 385
23:19:52 [50/50] 22 76 2 0 2276 825 1248 121 379
23:19:53 [50/50] 29 70 1 0 2195 787 1378 130 371
23:19:54 [50/50] 43 55 2 0 2075 767 1490 112 365
23:19:55 [50/50] 39 61 0 0 1827 965 1617 127 359
23:19:56 [50/50] 29 71 0 0 1951 646 1715 98 360
23:19:57 [50/50] 37 63 0 0 1611 946 1799 84 365
23:19:58 [50/50] 45 55 0 0 1671 834 1912 113 366
23:19:59 [50/50] 34 66 0 0 1867 705 2023 111 362
23:20:00 [50/50] 39 61 0 0 2235 889 2137 114 358
23:20:01 [50/50] 40 60 0 0 1931 859 2245 108 357
23:20:02 [50/50] 36 64 0 0 1866 892 2362 117 355
23:20:03 [50/50] 38 62 0 0 2758 734 2450 88 353
23:20:04 [50/50] 42 58 0 0 3191 913 2539 89 351
23:20:05 [50/50] 47 53 0 0 2451 935 2636 97 352
23:20:06 [50/50] 48 52 0 0 2059 652 2725 89 350
23:20:07 [50/50] 42 58 0 0 2575 995 2802 77 348
23:20:08 [50/50] 42 58 0 0 2295 658 2868 66 355


It can be seen that the 50 users [50/50] I tested here will soon be connected, and then the CPU information will have 4 columns (User, System, Wait, Idle), and the I / O information (Bi, Bo) will have two columns. Column, the last three columns (TPM, TPS, Response) are the amount of transactions per minute, the amount of transactions per second, and the response time.
Of course, because the test environment here is very low in configuration, and no special tuning has been done, the measured performance data is not very good, it is just for demonstration.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.