- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
19#
发表于 2013-9-13 13:07:21
2、关于 IO
通过IO calibrate测试 来了解IO
RAC:
RAC上第一次执行:
SQL> set serveroutput on;
SQL> DECLARE
2 lat INTEGER;
3 iops INTEGER;
4 mbps INTEGER;
5 BEGIN
6 --DBMS_RESOURCE_MANAGER.CALIBRATE_IO (disk_count,max_latency , iops, mbps, lat);
7 DBMS_RESOURCE_MANAGER.CALIBRATE_IO (20, 15, iops, mbps, lat);
8 DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
9 DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
10 dbms_output.put_line('max_mbps = ' || mbps);
11 end;
12 /
max_iops = 4137
latency = 13
max_mbps = 427
PL/SQL procedure successfully completed.
RAC上第二次执行:
SQL> set serveroutput on;
SQL> DECLARE
2 lat INTEGER;
3 iops INTEGER;
4 mbps INTEGER;
5 BEGIN
6 --DBMS_RESOURCE_MANAGER.CALIBRATE_IO (disk_count,max_latency , iops, mbps, lat);
7 DBMS_RESOURCE_MANAGER.CALIBRATE_IO (20, 15, iops, mbps, lat);
8 DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
9 DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
10 dbms_output.put_line('max_mbps = ' || mbps);
11 end;
12 /
max_iops = 4182
latency = 13
max_mbps = 435
PL/SQL procedure successfully completed.
单实例:
单实例上第一次执行:
SQL> set serveroutput on;
SQL> DECLARE
2 lat INTEGER;
3 iops INTEGER;
4 mbps INTEGER;
5 BEGIN
6 --DBMS_RESOURCE_MANAGER.CALIBRATE_IO (disk_count,max_latency , iops, mbps, lat);
7 DBMS_RESOURCE_MANAGER.CALIBRATE_IO (20, 15, iops, mbps, lat);
8 DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
9 DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
10 dbms_output.put_line('max_mbps = ' || mbps);
11 end;
12 /
max_iops = 586
latency = 14
max_mbps = 64
PL/SQL procedure successfully completed.
单实例上第二次执行:
SQL> set serveroutput on;
SQL> DECLARE
2 lat INTEGER;
3 iops INTEGER;
4 mbps INTEGER;
5 BEGIN
6 --DBMS_RESOURCE_MANAGER.CALIBRATE_IO (disk_count,max_latency , iops, mbps, lat);
7 DBMS_RESOURCE_MANAGER.CALIBRATE_IO (20, 15, iops, mbps, lat);
8 DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
9 DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
10 dbms_output.put_line('max_mbps = ' || mbps);
11 end;
12 /
max_iops = 663
latency = 15
max_mbps = 64
PL/SQL procedure successfully completed.
上面可以看到 RAC的IO iops 4000多 mbps 450M左右, 而单机 iops 600左右 mbps 64M
按道理来说RAC的IO 还是比单机好
但为什么之前的执行中 RAC比单机慢?
==》 我想主要是因为 文件系统缓存,因为单机使用了 文件系统, 而 RAC是用ASM的- SQL ID: 3hyucdmmh9s9m
- Plan Hash: 1322927158
- select count(*)
- from
- customer_temp
- call count cpu elapsed disk query current rows
- ------- ------ -------- ---------- ---------- ---------- ---------- ----------
- Parse 1 0.00 0.00 0 0 0 0
- Execute 1 0.00 0.00 0 0 0 0
- Fetch 2 1.65 1.65 155837 155843 0 1
- ------- ------ -------- ---------- ---------- ---------- ---------- ----------
- total 4 1.65 1.65 155837 155843 0 1
- Misses in library cache during parse: 1
- Optimizer mode: ALL_ROWS
- Parsing user id: 86 (CRM)
- Rows Row Source Operation
- ------- ---------------------------------------------------
- 1 SORT AGGREGATE (cr=155843 pr=155837 pw=0 time=0 us)
- 2434230 TABLE ACCESS FULL CUSTOMER_TEMP (cr=155843 pr=155837 pw=0 time=1718475 us cost=42429 size=0 card=2434230)
- Rows Execution Plan
- ------- ---------------------------------------------------
- 0 SELECT STATEMENT MODE: ALL_ROWS
- 1 SORT (AGGREGATE)
- 2434230 TABLE ACCESS MODE: ANALYZED (FULL) OF 'CUSTOMER_TEMP' (TABLE)
- Elapsed times include waiting on following events:
- Event waited on Times Max. Wait Total Waited
- ---------------------------------------- Waited ---------- ------------
- SQL*Net message to client 2 0.00 0.00
- Disk file operations I/O 4 0.00 0.00
- db file sequential read 1 0.00 0.00
- direct path read 38994 0.00 0.63
- SQL*Net message from client 2 7.81 7.81
复制代码 单机物理读取155837 个物理块( 大约1217M)的数据 仅用了1.65 秒,配合上面 单机 iops 600左右 mbps 64M 不借助 文件系统缓存是不可能的。 单机有62.9 G的物理内存 |
|