대량 DML 로 인한 gc 대기 잡기

갑자기 DB가 Hang이 걸리거나 WAS에서 큐가 마구 쌓일 때, 일단 대기를 살펴보자.

잽싸게

create table pnc$active_ses as
select * from v$active_session_history


를 해놓고 초단위로 IO, User, Cluster, Concurrency , Other등의 Wait Class 별로 발생빈도를 측정한다. 그러면 어떤 순서로 대기가 발생했는지 알 수 있고 DB에서 무슨 일이 벌어졌는지 실마리를 잡을 수 있다.

어제 대량 DML 로 인한 gc 대기를 그렇게 잡았다.

위의 방식으로 살펴보니 instance 레벨에서 Cluster 대기가 엄청 발생하고, 그 후에 Concurrency 가 발생했다. 주로 gc cr current block-2way 와 gc cr request 가 먼저 왕창 생기고 그 후에 latch: cache buffer chains 가 발생했는데...

http://wiki.ex-em.com/index.php/Gc_cr/current_block_2-way 참고
http://wiki.ex-em.com/index.php/Gc_cr/current_request 참고

current block 인 것으로 보아 갑자기 대량 DML이 발생한 것 같아서 여기저기 수소문해보니 그런 일이 있었다. 업무적으로 이걸 막기는 힘든 상황.. 마침 gc cr block lost 도 많이 보여서 UDP 패킷 사이즈를 체크.

* gc cr/current request - Tuning
 
비효율적인 네트워크 설정
 - Gigabit Ethernet Interconnect에서는 UDP(User Diagram Protocol) 사용
 - 확인 방법 :
 SQL> oradebug setmypid
 SQL> oradebug ipc
 SQL> oradebug tracefile_name
 
[예제]
PCSDB1:SQL>oradebug setmypid
Statement processed.
PCSDB1:SQL>oradebug ipc
Information written to trace file.
PCSDB1:SQL>oradebug tracefile_name
/cs_orahome/oracle/10.2.0/admin/PCSDB1_csdb1/udump/pcsdb1_ora_11771.trc
PCSDB1:SQL>exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining Scoring Engine options
[PCSDB1] /cs_orahome/oracle/10.2.0/rdbms/admin> vi /cs_orahome/oracle/10.2.0/admin/PCSDB1_csdb1/udump/pcsdb1_ora_11771.trc
 
* 결과
locked 1
blocked 0
timed wait receives 0
admno 0xfe8bc48 admport:
SSKGXPT 0x217880 flags SSKGXPT_READPENDING      socket no 8     IP 10.1.1.1     UDP 58379
context timestamp 0
        no ports
 
 - RAC Interconnect 성능과 가장 연관 있는 것은 UDP Buffer Size.
 - 오라클 권장 UDP buffer size = 256K
 - UDP Buffer Size가 작으면 패킷유실(Packet loss) 현상이 발생. (gc cr/current block lost 발생)
 
 * 패킷 유실 확인
 [PCSDB1] /cs_orahome/oracle> netstat -s -p udp
udp:
        57726 incomplete headers
        4795 bad checksums
        52931 socket overflows
 
 
# 아래 metalink 문서에서는 HP-UX서버에서는 UDP 튜닝이 안되는걸로 확인됨
 1.문서변경 : Reference site확인결과
 UDP Send buffer size는 64K로 Fix되어 다른 값으로 변경 할 수 없고
 UDP Receive buffer size는 ndd명령으로 변경가능함
 
 2. Reference Site size
 - 메리츠 증권 : 1M
 - 신한은행 : 2G
 - SKT : 1M

OS 커널 파라미터를 UDP 패킷 버퍼 1M 로 변경하고 나니 문제 해결~~~

오늘의 교훈

뭔 일이 생기면 일단 active_session_history 를 덤프떠놓고 세심하게 분석해보자!!

Posted by maceo

12 18, 2008 19:46 12 18, 2008 19:46
, , ,
Response
No Trackback , No Comment
RSS :
http://merritt.co.kr/tt/rss/response/122

Trackback URL : http://merritt.co.kr/tt/trackback/122

Leave a comment
[로그인][오픈아이디란?]
« Previous : 1 : ... 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : ... 74 : Next »

블로그 이미지

가늘어도 긴놈이 장땡

- maceo

Archives

Authors

  1. maceo

Calendar

«   9 2010   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Site Stats

Total hits:
179781
Today:
28
Yesterday:
67