# Capture Server

### 준비사항&#x20;

* Capture 를 진행할 별도 장비에 Tibero 바이너리를 준비합니다.&#x20;
* Replay를 진행하기 위해 Replay Server를 구축할 Capture Server의 Database 콜드 백업본 사용을 권장합니다.&#x20;
* Capture 기능 사용 시 Capture file 이 쓰여지므로 OS의 Kernel, Shell Limit의 FD 관련 파라미터를 최소 MAX\_SESSION\_COUNT \* 3 만큼 추가합니다.

{% hint style="info" %}
커널 파라미터의 값을 변경한 경우에는 반드시 시스템을 다시 기동시킵니다.
{% endhint %}

***\[예] 커널 파라미터 증가***

1. **Capture Server의 Tibero tip 파일에서 MAX\_SESSION\_COUNT 확인**&#x20;

<$TB\_HOME/config/$TB\_SID.tip>

{% code fullWidth="false" %}

```
MAX_SESSION_COUNT=100de
```

{% endcode %}

2. **Capture Server의 Tibero tip 파일에서 MAX\_SESSION\_COUNT 확인**&#x20;

\</etc/security/limits.conf>

{% code fullWidth="false" %}

```
tibero soft nofile 131070 
tibero hard nofile 131070
```

{% endcode %}

3. **Capture Server의 커널 파라미터 중 capture server user의 nofile 값에 100\*3 만큼 추가**

```
tibero soft nofile 131370 
tibero hard nofile 131370
```

4. **Capture Server의 Shell Limits 중 fs.file-max 값 확인**&#x20;

\</etc/sysctl.conf>

```
fs.file-max = 6815744
```

5. **Capture Server의 Shell Limits 중 fs.file-max 값에 100\*3 만큼 추가**

```
fs.file-max = 6816044
```

Capture File이 쓰여지는 Capture 디렉토리의 사이즈는 Capture Server 의 tip 파일에 DATABASE\_REPLAY\_CAPTURE\_DIR\_LIMIT 파라미터로 OS Disk 가용 범위 내 설정이 가능합니다.                      단, DATABASE\_REPLAY\_CAPTURE\_DIR\_LIMIT이 넘어가면 capture가 자동으로 중지됩니다.&#x20;

Capture file 이 쓰여짐에 따라 Disk I/O 및 CPU/Memory 에 부하가 가해질 수 있으므로 파일이 저장될 경로는 별도의 디 스크 사용을 권장합니다.

### 관련 환경 영향도 테스트&#x20;

다음은 Capture 기능이 활성화 될 때 관련 환경에 미치는 대한 영향도 예시입니다.

#### 테스트 환경

* TPC-C (benchmarkSQL 5.0)&#x20;
* Warehouse 500&#x20;
* Terminal 300&#x20;
* runMins 10M&#x20;

#### 테스트 결과

다음은 Capture 기능을 각각 OFF/ON 상태에서 3번씩 테스트 수행한 결과 입니다.&#x20;

<table><thead><tr><th width="143">캡처 기능</th><th width="120">tpmC</th><th width="132">Capture File</th><th width="170">Disk Write (KB/s)</th><th>CPU (%)</th></tr></thead><tbody><tr><td>Capture OFF</td><td>68539.05</td><td>-</td><td>98677.2</td><td>66.6</td></tr><tr><td></td><td>68216.19</td><td>-</td><td>92390.3</td><td>66.3</td></tr><tr><td></td><td>66486.73</td><td>-</td><td>86810.4</td><td>64.4</td></tr><tr><td>Capture ON</td><td>62823.98</td><td>1330개(7.2G)</td><td>114057.2</td><td>66.5</td></tr><tr><td></td><td>63442.13</td><td>1339개(7.3G)</td><td>114200.4</td><td>67.1</td></tr><tr><td></td><td>62710.63</td><td>1334개(7.2G)</td><td>113040.9</td><td>66.2</td></tr></tbody></table>

다음은 위 내용의 결과를 요약한 표 입니다.

<table><thead><tr><th width="178">항목</th><th width="147">Capture OFF</th><th width="140">Capture ON</th><th width="136">차이</th><th>증가 및 감소율</th></tr></thead><tbody><tr><td>Disk Write (KB/s)</td><td>92625.97</td><td>113766.17</td><td>+21040.20</td><td>22.72 % ↑</td></tr><tr><td>CPU (%)</td><td>65.77</td><td>66.60</td><td>+0.83</td><td>0.83 % ↑</td></tr><tr><td>tpmc</td><td>67747.32</td><td>62992.25</td><td>-4755.07</td><td>7.02 % ↓</td></tr></tbody></table>

### 설치 및 구성&#x20;

* Tibero 바이너리 설치방법은 Tibero 온라인 메뉴얼의 데이터베이스 설치에서 확인할 수 있습니다.           (위치: Tibero7 온라인 메뉴얼 > Tibero 설치 안내서 > 3. 데이터베이스 설치)&#x20;
* TAC 구성방법은Tibero 온라인 메뉴얼 내 관리자 안내서의 TAC 구성에서 확인할 수 있습니다.                   (위치: Tibero7 온라인 메뉴얼 > Tibero 관리자 안내서 > 14.6. TAC 구성)

{% hint style="info" %}
[Tibero 온라인 메뉴얼 바로가기](https://technet.tmax.co.kr/upload/download/online/tibero/pver-20220224-000002/index.html)
{% endhint %}

설치 완료 후에는 Capture 기능 사용을 위한 작업으로서, 현재 Tibero 바이너리 관련 파라미터들의 존재여부를 확인합니다.

#### Capture 기능 관련 파라미터 확인

{% code overflow="wrap" %}

```
SQL> show param DATABASE_REPLAY

NAME                                                     TYPE     VALUE                      
----------------------------------------------------- -------- ------------
DATABASE_REPLAY_CAPTURE_DEST                           DIRNAME 
/home/tibero6/capture_files/
DATABASE_REPLAY_CAPTURE_DIR_LIMIT                      UINT64   367001600000
DATABASE_REPLAY_CAPTURE_FILE_SIZE                      INT32    10485760
DATABASE_REPLAY_CAPTURE_WORKLOAD                       Y_N      YES
```

{% endcode %}

**파라미터 설명**&#x20;

* DATABASE\_REPLAY\_CAPTURE\_DEST - 캡쳐된 서버 부하가 파일 형태로 저장될 디렉토리 위치              설정 시 절대 경로로 지정
* DATABASE\_REPLAY\_CAPTURE\_WORKLOAD - 서버 부하를 캡쳐할지 여부를 정하는 파라미터                  파라미터 설정 시 클라이언트 프로그램으로부터 수신된 모든 요청이 세션 단위로 캡처
* DATABASE\_REPLAY\_CAPTURE\_FILE\_SIZE - capture dump file 하나의 최대 크기&#x20;
* DATABASE\_REPLAY\_CAPTURE\_DIR\_LIMIT - capture dump file 전체의 최대 크기                                 서버는 주기적으로 캡쳐된 파일들의 크기를 확인하며 전체 크기가 최댓값 제한에 가까워졌을 경우 추가적인 캡쳐를 중단

기능 사용을 위해 Capture Server의 Tibero tip 파일에 DATABASE\_REPLAY\_CAPTURE\_DEST를 필수적으로 작성하고, Tibero를 재기동 합니다. 관련 예시는 Capture Server [**환경구성의 준비사항**](#undefined)에서 확인할 수 있습니다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tmaxtibero-resource-docs.gitbook.io/dbreplay/undefined-1/capture-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
