当前位置:网站首页>enq: HW – contention等待引起的故障分析
enq: HW – contention等待引起的故障分析
2022-07-25 07:56:00 【墨天轮】
故障概述
客户xxx相关应用系统于26与28两日的13点至15点高并发,数据库连接数超过限制(10000)。
解决方案已出:把xml_info_yyyymm表建为hash分区。
下面是故障分析诊断过程,以及解决方案。
故障分析
故障现象
xxx应用系统于26与28两日的13点至15点高并发,数据库连接数超过限制(10000)。频繁收告警数据库 DOWN,实际上只是新的连接进不去,数据库后台日志也是报连接超过限制。
故障根源
应用高并发insert导致且xml_info_yyyymm表过大且没有分区,数据库大量等待事件出现:enq: HW – contention,此等待事件造成会话严重堵塞,最后连接数超过限制。
等待事件分析可参考官方文档:ID 740075.1
故障解决
杀连接,停应用
解决方案及总结
解决目标是解决xml_info_yyyymm的enq: HW – contention等待,方法是:根据xml_info_yyyymm的主键创建hash分区。效果已经经过测试环境进行测试,1500并发情况下,hash分区后enq: HW – contention下降10倍以上。通过AWR对比能清楚得到证实


hash分区后enq: HW – contention已经不在top5事件里面。
下面看具体值
Hash分区前

Hash分区后

对比以上两图可以看出:enq: HW – contention 的wait次数从44395下降为4482,平均等待时长从2毫秒下降为1毫秒。
创建脚本如下
CREATE TABLE XML_INFO_201708
( DONE_CODE NUMBER(12,0) NOT NULL ENABLE,
ACTIVITY_WAY NUMBER(1,0) NOT NULL ENABLE,
ACTIONCODE NUMBER(1,0) NOT NULL ENABLE,
XML_DATA CLOB,
CONSTRAINT PK_XML_INFO1_201708 PRIMARY KEY (DONE_CODE, ACTIVITY_WAY, ACTIONCODE)
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE CBOSS_DATA ENABLE
)partition by hash (DONE_CODE, ACTIVITY_WAY,ACTIONCODE)
(
partition P1 tablespace CBOSS_DATA,
partition P2 tablespace CBOSS_DATA,
partition P3 tablespace CBOSS_DATA,
partition P4 tablespace CBOSS_DATA,
partition P5 tablespace CBOSS_DATA,
partition P6 tablespace CBOSS_DATA,
partition P7 tablespace CBOSS_DATA,
partition P8 tablespace CBOSS_DATA,
partition P9 tablespace CBOSS_DATA,
partition P10 tablespace CBOSS_DATA,
partition P11 tablespace CBOSS_DATA,
partition P12 tablespace CBOSS_DATA,
partition P13 tablespace CBOSS_DATA,
partition P14 tablespace CBOSS_DATA,
partition P15 tablespace CBOSS_DATA,
partition P16 tablespace CBOSS_DATA,
partition P17 tablespace CBOSS_DATA,
partition P18 tablespace CBOSS_DATA,
partition P19 tablespace CBOSS_DATA,
partition P20 tablespace CBOSS_DATA,
partition P21 tablespace CBOSS_DATA,
partition P22 tablespace CBOSS_DATA,
partition P23 tablespace CBOSS_DATA,
partition P24 tablespace CBOSS_DATA,
partition P25 tablespace CBOSS_DATA,
partition P26 tablespace CBOSS_DATA,
partition P27 tablespace CBOSS_DATA,
partition P28 tablespace CBOSS_DATA,
partition P29 tablespace CBOSS_DATA,
partition P30 tablespace CBOSS_DATA,
partition P31 tablespace CBOSS_DATA,
partition P32 tablespace CBOSS_DATA,
partition P33 tablespace CBOSS_DATA,
partition P34 tablespace CBOSS_DATA,
partition P35 tablespace CBOSS_DATA,
partition P36 tablespace CBOSS_DATA,
partition P37 tablespace CBOSS_DATA,
partition P38 tablespace CBOSS_DATA,
partition P39 tablespace CBOSS_DATA,
partition P40 tablespace CBOSS_DATA,
partition P41 tablespace CBOSS_DATA,
partition P42 tablespace CBOSS_DATA,
partition P43 tablespace CBOSS_DATA,
partition P44 tablespace CBOSS_DATA,
partition P45 tablespace CBOSS_DATA,
partition P46 tablespace CBOSS_DATA,
partition P47 tablespace CBOSS_DATA,
partition P48 tablespace CBOSS_DATA,
partition P49 tablespace CBOSS_DATA,
partition P50 tablespace CBOSS_DATA,
partition P51 tablespace CBOSS_DATA,
partition P52 tablespace CBOSS_DATA,
partition P53 tablespace CBOSS_DATA,
partition P54 tablespace CBOSS_DATA,
partition P55 tablespace CBOSS_DATA,
partition P56 tablespace CBOSS_DATA,
partition P57 tablespace CBOSS_DATA,
partition P58 tablespace CBOSS_DATA,
partition P59 tablespace CBOSS_DATA,
partition P60 tablespace CBOSS_DATA,
partition P61 tablespace CBOSS_DATA,
partition P62 tablespace CBOSS_DATA,
partition P63 tablespace CBOSS_DATA,
partition P64 tablespace CBOSS_DATA
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE CBOSS_DATA
LOB (XML_DATA) STORE AS BASICFILE (
TABLESPACE CBOSS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
其他建议
应用方面,也可以按照日分区。
影响评估
优化建议的实施是否有对现有业务的影响:
不会。只是改为分区表,主键依然保留。所以,对插入有改善,对主键查询无影响,对索引范围查询效率有一定影响。
官方参考文档:ID 740075.1
边栏推荐
- 【Unity入门计划】基本概念-触发器 Trigger
- What products and funds should novices invest in first?
- Analysis of difficulties in diagramscene project
- Introduction and installation of mongodb
- 轮询、中断、DMA和通道
- Dijkstra序列(暑假每日一题 5)
- While (~scanf ("%d", & n)) is equivalent to while (scanf ("%d", & n)! =eof)
- App power consumption test
- 如何仅用递归函数和栈操作逆序一个栈
- Vscode remote connection server, switch to go version
猜你喜欢

Vscode remote connection server, switch to go version
![[paper notes] effective CNN architecture design guided by visualization](/img/aa/aeeac3f970eac7f110987c523602c8.png)
[paper notes] effective CNN architecture design guided by visualization

How to reverse a stack with recursive functions and stack operations only

Analysis of difficulties in diagramscene project

Practical operation: elegant downtime under large-scale micro service architecture
![[unity entry program] basic concept trigger](/img/16/cd0f8ae579627fc095935195136729.png)
[unity entry program] basic concept trigger

What has become a difficult problem for most people to change careers, so why do many people study software testing?

Completely replace the redis+ database architecture, and JD 618 is stable!

eval与assert一句话木马分析

Oracle trigger creation
随机推荐
Introduction to machine learning (I): understanding maximum likelihood estimation in supervised learning
P1047 [noip2005 popularization group t2] tree outside the school gate
batchnorm 和layernorm的区别
Problems in deep learning training and testing: error: the following arguments are required: --dataroot, solution: the configuration method of training files and test files
[unity introduction program] basic concepts GameObject & components
Introduction to cesium
[QNX Hypervisor 2.2用户手册]9.3 cpu
设计一个有getMin功能的栈
如何仅用递归函数和栈操作逆序一个栈
Network file storage system (II) practical operation of Minio distributed file system
使用CycleGAN训练自己制作的数据集,通俗教程,快速上手
Kubernetes monitoring component metrics server deployment
Load capacity - sorting out the mind map that affects load capacity
How to do a good job in safety development?
Competition path design of beacon group
Oracle19 adopts automatic memory management. The AWR report shows that the settings of SGA and PGA are too small?
【Unity入门计划】制作我的第一个小游戏
Offline base tile, which can be used for cesium loading
Introduction and principle explanation of 30 common sensor modules in IOT embedded devices
[audio and video] picture YUV data format