보통의 사이트에서 Redo log 크기에 대해 언급할 때마다 너무 커지면 성능 저하가 일어나지 않을까 우려하는 경우를 자주 접하게 됩니다.

그런데 사실 Redo 로그는 커질수록 성능에 유리합니다.

너무 로그 스위치가 자주 일어나면 아카이빙 및 체크포인트가 자주 발생하게 되므로 archiver 프로세스와 DBWR 프로세스가 바빠집니다.

v$log_history 뷰를 조회해보면 로그 스위치가 얼마나 자주 일어나는지 알 수 있습니다.

오라클의 권고안은 20분에 한번씩 일어나는 것입니다. 이 권고안을 반드시 준수할 필요는 없지만 적어도 5~10분 사이에 한번씩 로그 스위치가 일어나도록 설정해주는 것을 권장합니다.

 

Redo 로그가 커져서 불리한 점은 instance recovery 시간입니다.

 

즉, 어떤 이유로 오라클 인스턴스가 crash되어 Startup 시 복구하고 올라와야할 때 기동 시간이 더 길어질 수 있습니다만…

사실 이것도 너무 걱정할 필요가 없습니다. 정말 instance recovery time이 걱정된다면 fast_start_mttr_target 파라미터를 활용해볼 것을 권고 드립니다.

최근 경향은 Redo 크기를 수백 메가에서 수 십 기가바이트까지 설정하는 경우가 많습니다.

Redo가 지나치게 작으면log file switch completion 등 대기 이벤트가 문제가 될 수 있습니다.

 

====

 

오라클 공식 매뉴얼에서도 다음과 같이 권고하고 있습니다.

 

 

다음은 내용을 번역한 것입니다.

 

“Database writer(dbwr)와 archive 프로세스의 동작이 redo 로그 크기에 달려있기 때문에 Redo 로그 파일의 크기는 성능에 영향을 미칠 수 있다.

일반적으로 Redo 로그 파일의 크기가 클수록 더 나은 성능을 제공한다. 보통 이하의 크기로 설정된 로그 파일은 체크포인트 활동을 증가시키고 성능을 감소시킨다.

redo 로그 파일의 크기가 LGWR 성능에 영향을 미치지는 않지만, DBWR와 체크포인트 동작에는 영향을 미칠 수 있다. 체크포인트 주기는 로그 파일 크기와

FAST_START_MTTR_TARGET의 설정을 포함한 여러 요소에 의해 영향을 받는다. 만약 인스턴스 복구 시간을 제한하기 위해 FAST_START_MTTR_TARGET 파라미터를 설정했다면,

오라클 데이터베이스는 자동으로 필요한 만큼 자주 체크 포인트를 시도한다.

이 조건 하에서 로그 파일의 크기는 작게 설정된 로그 파일 때문에 추가 체크포인트가 일어나지 않을 만큼 충분히 커야 한다.

최적의 크기는 V$INSTANCE_RECOVERY 뷰의 OPTIMAL_LOGFILE_SIZE 칼럼을 조회하여 얻을 수 있다.

또한 오라클 엔터프라이즈 관리자의 Redo Log Groups 페이지에서 크기에 대한 조언을 얻을 수 있다.

최적의 Redo 로그 파일 크기를 권고하는 것이 항상 가능하지는 않지만, 100MB에서 수 기가 바이트의 범위로 Redo 로그 파일을 설정하는 것이 적당하다고 생각된다.

온라인 Redo 로그 파일의 크기는 시스템에서 생성되는 redo의 양에 달려있다. 대략적인 권고안은 20분 마다 로그 스위치가 일어나도록 설정하는 것이다.”

 

 

https://docs.oracle.com/cd/E11882_01/server.112/e41573/build_db.htm#PFGRF013

Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administration

Database Performance Tuning Guide

4 Configuring a Database for Performance

 

4.1.3 Sizing Redo Log Files

The size of the redo log files can influence performance, because the behavior of the database writer and archiver processes depend on the redo log sizes. Generally, larger redo log files provide better performance. Undersized log files increase checkpoint activity and reduce performance.

Although the size of the redo log files does not affect LGWR performance, it can affect DBWR and checkpoint behavior. Checkpoint frequency is affected by several factors, including log file size and the setting of the FAST_START_MTTR_TARGET initialization parameter. If the FAST_START_MTTR_TARGET parameter is set to limit the instance recovery time, Oracle Database automatically tries to checkpoint as frequently as necessary. Under this condition, the size of the log files should be large enough to avoid additional checkpointing due to under sized log files. The optimal size can be obtained by querying the OPTIMAL_LOGFILE_SIZE column from the V$INSTANCE_RECOVERY view. You can also obtain sizing advice on the Redo Log Groups page of Oracle Enterprise Manager.

It may not always be possible to provide a specific size recommendation for redo log files, but redo log files in the range of 100 MB to a few gigabytes are considered reasonable. Size online redo log files according to the amount of redo your system generates. A rough guide is to switch log files at most once every 20 minutes.

By haisins

오라클 DBA 박용석 입니다. haisins@gmail.com 으로 문의 주세요.

One thought on “REDO LOG FILE 사이즈”

답글 남기기

이메일 주소를 발행하지 않을 것입니다. 필수 항목은 *(으)로 표시합니다