# Session Monitoring

글로벌 내비게이션 바에서 **\[Realtime] > \[Main Monitoring] > \[Session Monitoring]** 를 클릭하면 Session Monitoring 페이지가 열린다.

Session Monitoring 페이지에서는 관제 대상 DB에서 수집 agent를 통하여 직접 세션 정보를 조회한 화면으로, 현재 연결되어 있는 세션별 I/O read , I/O write, elapsed time, wait event 등 session의 현 상황을 모니터링한 정보를 보여준다.

SID, user name, program 등 각 컬럼별로 filtering 기능을 제공한다. Configurable Privileges 중 선택한 인스턴스에 대해 \[Kill Session] 권한이 부여된 사용자는 해당 인스턴스의 세션을 종료할 수 있다.

## Session 모니터링 주요기능

### **Session 목록**

관제 대상 DB의 각 session 정보를 테이블 형식으로 보여주고, last update를 명시하여 현재 어떤 시간의 정보인지 확인할 수 있다.

<figure><img src="/files/Cl2OwRlS86zY1DEcgi9C" alt=""><figcaption></figcaption></figure>

| 항목                | 설명                                                                                                                                                                                                                                                                                                                                             |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PID               | PostgreSQL 백엔드 프로세스 PID                                                                                                                                                                                                                                                                                                                        |
| DB Name           | 접속한 데이터베이스 이름                                                                                                                                                                                                                                                                                                                                  |
| Elapsed Time      | 현재 수행 중인 SQL의 경과 시간                                                                                                                                                                                                                                                                                                                            |
| User Name         | 세션 사용자 이름                                                                                                                                                                                                                                                                                                                                      |
| Application Name  | 클라이언트 애플리케이션 이름                                                                                                                                                                                                                                                                                                                                |
| IO Read           | 누적 읽기 I/O 바이트                                                                                                                                                                                                                                                                                                                                  |
| IO Write          | 누적 쓰기 I/O 바이트                                                                                                                                                                                                                                                                                                                                  |
| State             | <p>세션의 상태</p><p></p><ul><li>starting: 접속 생성·인증 등 초기화 중</li><li>active: SQL 실행 중(락/I/O 대기 포함)</li><li>idle: SQL 없음, 다음 요청 대기 중</li><li>idle in transaction: 트랜잭션 열고 쿼리 없이 대기</li><li>idle in transaction (aborted): 에러로 중단, ROLLBACK 대기</li><li>fastpath function call: SQL 대신 Fastpath 함수 호출 처리</li><li>disabled: 상태 추적 비활성/표기 불가 상태</li></ul> |
| SQL Text          | 현재 실행 중인 SQL 텍스트                                                                                                                                                                                                                                                                                                                               |
| IP Address        | 클라이언트 IP                                                                                                                                                                                                                                                                                                                                       |
| Client Hostname   | 클라이언트 호스트 이름                                                                                                                                                                                                                                                                                                                                   |
| Client Port       | 클라이언트 포트                                                                                                                                                                                                                                                                                                                                       |
| State Change      | 상태가 마지막으로 바뀐 시각                                                                                                                                                                                                                                                                                                                                |
| Backend Start     | 백엔드 프로세스 시작 시각                                                                                                                                                                                                                                                                                                                                 |
| Xact Start        | 현재 트랜잭션 시작 시각                                                                                                                                                                                                                                                                                                                                  |
| Query Start       | 현재 쿼리 시작 시각                                                                                                                                                                                                                                                                                                                                    |
| Wait Event Type   | 대기 이벤트 유형                                                                                                                                                                                                                                                                                                                                      |
| Wait Event        | 대기 이벤트 이름                                                                                                                                                                                                                                                                                                                                      |
| Query ID          | 쿼리 식별 ID                                                                                                                                                                                                                                                                                                                                       |
| Backend Type      | <p>백엔드 유형</p><ul><li>client backend: 클라이언트 연결 세션(일반 백엔드)</li><li>parallel worker: 병렬 쿼리 수행 워커 프로세스</li></ul>                                                                                                                                                                                                                                   |
| Xact Elapsed Time | 현재 트랜잭션 경과 시간                                                                                                                                                                                                                                                                                                                                  |
| Backend XID       | 현재 트랜잭션 ID                                                                                                                                                                                                                                                                                                                                     |
| Backend Xmin      | MVCC 최소 XID                                                                                                                                                                                                                                                                                                                                    |
| RSS               | 실제 메모리 사용량 (Resident Set Size)                                                                                                                                                                                                                                                                                                                 |
| VSize             | 프로세스가 잡아둔(매핑/예약한) 가상 주소공간 총합(Virtual Memory Size)                                                                                                                                                                                                                                                                                              |

### **Long running session 모니터링**

사용자는 Elapsed Time의 기준을 설정할 수 있으며, 설정된 범위로 어떤 세션이 오래 수행되었는지를 색상을 통해 직관적으로 파악할 수 있다.

<figure><img src="/files/7nJGGVg1Ym1ejfBN5UEq" alt=""><figcaption></figcaption></figure>

### **Kill Session**

세션을 Kill 시킬 수 있다. Session Monitoring 기능에 대한 권한(Privileges)이 Full로 설정된 유저만 수행할 수 있으며, Session 목록에서 특정 세션을 클릭해야만 해당 버튼이 표시된다.&#x20;

<figure><img src="/files/exlXWIFSVvtXOYTDbBms" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**참고**

해당 인스턴스의 세션을 종료할 수 있다(Session Kill). Configurable Privileges 중 선택한 인스턴스에 대해 \[Kill Session] 권한이 부여된 사용자에 한해 사용할 수 있는 기능이다.
{% endhint %}

<figure><img src="/files/7uhQyQvNzOCcHbxvFc0L" alt=""><figcaption></figcaption></figure>

**\[Kill Session]** 버튼을 클릭하면 Kill Session 팝업창이 열린다. 이때 해당 세션을 Kill 하거나 동작을 취소할 수 있다.

<figure><img src="/files/DVITpvo6Tx6to00PDnkk" alt=""><figcaption><p>SuperUser Session Kill 시도한 경우</p></figcaption></figure>

모니터링 계정에는 `SUPERUSER` 권한이 부여되어 있지 않으므로, `SUPERUSER` 계정이 실행 중인 세션은 종료할 수 없다. 세션 종료 기능은 해당 모니터링 계정과 동일한 사용자 또는 적절한 권한을 가진 계정이 생성한 세션에 대해서만 수행할 수 있다. `SUPERUSER` 세션 종료가 필요한 경우에는 `SUPERUSER` 계정으로 직접 수행해야 한다.

아래는 Kill Session 팝업창에서 제공하는 정보에 대한 설명이다.

<table><thead><tr><th width="298">항목</th><th>설명</th></tr></thead><tbody><tr><td>PID</td><td>PostgreSQL 백엔드 프로세스 PID</td></tr><tr><td>State</td><td>세션의 상태</td></tr><tr><td>DB Name</td><td>접속한 데이터베이스 이름</td></tr><tr><td>User Name</td><td>세션 사용자 이름</td></tr><tr><td>Application Name</td><td>클라이언트 애플리케이션 이름</td></tr><tr><td>Wait Event</td><td>대기 이벤트 이름</td></tr></tbody></table>


---

# 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://docs.tibero.com/sysmasterdb-for-postgresql1.0/8.3_manual/realtime/main-monitoring/session-monitoring.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.
