Database Replay加压播放参数之SCALE_UP_MULTIPLIER
当我们要迁移到新的环境之前,我们都想测试下我们新的环境是否能负荷生产的负载。同时,对于一些特殊的应用场景,我们还需要考虑模拟更大的并发量来测试是否能顶住未来的压力。举个简单的例子,我搞个电子商务的网站,我现在每秒能支持1000个人同时在线做查
当我们要迁移到新的环境之前,我们都想测试下我们新的环境是否能负荷生产的负载。同时,对于一些特殊的应用场景,我们还需要考虑模拟更大的并发量来测试是否能顶住未来的压力。举个简单的例子,我搞个电子商务的网站,我现在每秒能支持1000个人同时在线做查询,购买等等操作。那么未来我们的网站影响力得到了扩大,可能有更多的人进行访问,比如1万人、10万人,这个压力下我的数据库服务器能顶住吗?在这里不得不吐槽一下我们的某(tie)车(dao)票(bu)的网站,真是烂的要死,一到过年的时候,就卡个不行。他们真应该多做做这种加压测试。上一篇我们主要介绍了Database Replay基本使用,我们捕获了现有的压力,然后拿到新的环境上去播放,基本上是1比1的。这一篇我们要进行一个加压的播放,这主要取决于我们的参数SCALE_UP_MULTIPLIER。这个参数可以帮助我们把只读的操作按照比例进行扩大。对于DML、DDL,或者是修改数据库的PL/SQL代码以及SELECT FOR UPDATE都将被忽略掉。这个也比较容易理解,毕竟修改操作是独占不能共享的。
上一篇我们捕获的一个环境的数据如下,这里可以看到USER_CALLS为56次,那么我们加速10倍播放,一定会达到5600次。我们来实验一下。
SQL> select name, directory, status, start_time, end_time, USER_CALLS,TRANSACTIONS from dba_workload_captures; NAME DIRECTORY STATUS START_TIM END_TIME USER_CALLS TRANSACTIONS -------------------- --------------- --------------- --------- --------- ---------- ------------ test_capture_1 DATA_PUMP_DIR COMPLETED 20-APR-14 20-APR-14 56 10
1.预处理数据
SQL> exec dbms_workload_replay.process_capture('DATA_PUMP_DIR'); PL/SQL procedure successfully completed
2.执行重放
SQL> exec dbms_workload_replay.initialize_replay (replay_name => 'test_replay_1', replay_dir => 'DATA_PUMP_DIR'); PL/SQL procedure successfully completed. SQL> select id,name,PARALLEL,CAPTURE_ID,STATUS,USER_CALLS from DBA_WORKLOAD_REPLAYS; ID NAME PAR CAPTURE_ID STATUS USER_CALLS ---------- ------------------------------ --- ---------- ---------------------------------------- ---------- 61 test_replay_1 NO 65 INITIALIZED SQL> exec DBMS_WORKLOAD_REPLAY.prepare_replay (synchronization => TRUE,SCALE_UP_MULTIPLIER=>100); PL/SQL procedure successfully completed.
新开一个终端,在终端上的datadump目录下运行:
[oracle@11g dpdump]$ wrc system/oracle mode=replay replaydir=/oracle/app/oracle/admin/ora11/dpdump Workload Replay Client: Release 11.2.0.4.0 - Production on Mon Apr 21 20:57:38 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved. Wait for the replay to start (20:57:38)
切换回刚才的SQLPLUS窗口,开始执行Replay操作。
SQL> exec DBMS_WORKLOAD_REPLAY.START_REPLAY(); PL/SQL procedure successfully completed.
再看终端窗口的显示。
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@11g dpdump]$ wrc system/oracle mode=replay replaydir=/oracle/app/oracle/admin/ora11/dpdump Workload Replay Client: Release 11.2.0.4.0 - Production on Mon Apr 21 20:57:38 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved. Wait for the replay to start (20:57:38) Replay started (20:57:44) Replay finished (20:58:58)
完成后切换回SQLPLUS下执行查询。可以看到USER_CALLS是之前的10倍。
SQL> select id,name,PARALLEL,CAPTURE_ID,STATUS,USER_CALLS from DBA_WORKLOAD_REPLAYS; ID NAME PAR CAPTURE_ID STATUS USER_CALLS ---------- ------------------------------ --- ---------- ---------------------------------------- ---------- 61 test_replay_1 NO 65 COMPLETED 5600
再看看我们的事务,没有变化,发现还是10次。
SQL> connect test/test Connected. SQL> select count(1) from tt;?? COUNT(1) ---------- ??????? 10
通过这个参数,我们可以模拟更高的查询并发,预测生成环境未来的负载能力。同时,我们还可以生成更多的报告来进行对比。如果发现某些语句查询在1000个人下面正常,在1万、10万下就变得缓慢,那就需要去整改。比如逻辑读高的,一点点会话看不出什么问题的。一大堆会话就容易出现latch:cache buffer chains的等待。这能指导我们进行SQL调整。
原文地址:Database Replay加压播放参数之SCALE_UP_MULTIPLIER, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The solutions to discuz database error are: 1. Check the database configuration; 2. Make sure the database server is running; 3. Check the database table status; 4. Back up the data; 5. Clear the cache; 6. Reinstall Discuz; 7. Check the server resources ; 8. Contact Discuz official support. Solving Discuz database errors requires starting from multiple aspects, gradually identifying the cause of the problem, and taking corresponding measures to repair it.

IntelArrowLakeisexpectedtobebasedonthesameprocessorarchitectureasLunarLake,meaningthatIntel'sbrandnewLionCoveperformancecoreswillbecombinedwiththeeconomicalSkymontefficiencycores.WhileLunarLakeisonlyavailableasava

This quick guide will show you how to use AirPlay, Apple's innovative wireless streaming feature to easily share and display content. Allows you to use Wi-Fi to connect your iPhone or iPad to AirPlay-compatible Apple TVs, smart TVs, speakers, and Macs, as well as certain third-party speakers and smart TVs, for seamless data transfer. AirPlay operates on a peer-to-peer basis, connecting your Apple devices through the local network. It uses a combination of technologies, including Real-Time Transport Protocol (RTP) for streaming audio and video and Bonjour for device discovery. Simply put, when you use AirPlay, your device sends a stream of data and then

New feature of PHP5.4 version: How to use callable type hint parameters to accept callable functions or methods Introduction: PHP5.4 version introduces a very convenient new feature - you can use callable type hint parameters to accept callable functions or methods . This new feature allows functions and methods to directly specify the corresponding callable parameters without additional checks and conversions. In this article, we will introduce the use of callable type hints and provide some code examples,

Product parameters refer to the meaning of product attributes. For example, clothing parameters include brand, material, model, size, style, fabric, applicable group, color, etc.; food parameters include brand, weight, material, health license number, applicable group, color, etc.; home appliance parameters include brand, size, color , place of origin, applicable voltage, signal, interface and power, etc.

i9-12900H is a 14-core processor. The architecture and technology used are all new, and the threads are also very high. The overall work is excellent, and some parameters have been improved. It is particularly comprehensive and can bring users Excellent experience. i9-12900H parameter evaluation review: 1. i9-12900H is a 14-core processor, which adopts the q1 architecture and 24576kb process technology, and has been upgraded to 20 threads. 2. The maximum CPU frequency is 1.80! 5.00ghz, which mainly depends on the workload. 3. Compared with the price, it is very suitable. The price-performance ratio is very good, and it is very suitable for some partners who need normal use. i9-12900H parameter evaluation and performance running scores

Hyperbolic functions are defined using hyperbolas instead of circles and are equivalent to ordinary trigonometric functions. It returns the ratio parameter in the hyperbolic sine function from the supplied angle in radians. But do the opposite, or in other words. If we want to calculate an angle from a hyperbolic sine, we need an inverse hyperbolic trigonometric operation like the hyperbolic inverse sine operation. This course will demonstrate how to use the hyperbolic inverse sine (asinh) function in C++ to calculate angles using the hyperbolic sine value in radians. The hyperbolic arcsine operation follows the following formula -$$\mathrm{sinh^{-1}x\:=\:In(x\:+\:\sqrt{x^2\:+\:1})}, Where\:In\:is\:natural logarithm\:(log_e\:k)

During the development process, we may encounter such an error message: PHPWarning: in_array()expectsparameter. This error message will appear when using the in_array() function. It may be caused by incorrect parameter passing of the function. Let’s take a look at the solution to this error message. First, you need to clarify the role of the in_array() function: check whether a value exists in the array. The prototype of this function is: in_a
