1. 기본 클러스터 상태 확인
전체 클러스터 상태
# 클러스터 전체 상태 확인
ceph -s
ceph status
# 상세 상태 정보
ceph health detail
# 클러스터 용량 및 사용량
ceph df
ceph df detail
OSD 상태 확인
# OSD 상태 확인
ceph osd stat
ceph osd tree
ceph osd df
# 특정 OSD 상세 정보
ceph osd find {osd-id}
ceph tell osd.{id} version
2. 성능 측정 도구
2.1 rados bench (기본 성능 테스트)
쓰기 성능 테스트
# 10초간 4MB 객체로 쓰기 테스트
rados bench -p {pool-name} 10 write --no-cleanup
# 예시: rbd 풀에서 30초간 테스트
rados bench -p rbd 30 write --no-cleanup
# 동시 스레드 수 지정 (기본값: 16)
rados bench -p rbd 10 write -t 32 --no-cleanup
읽기 성능 테스트
# 순차 읽기 테스트
rados bench -p rbd 10 seq
# 랜덤 읽기 테스트
rados bench -p rbd 10 rand
# 테스트 후 정리
rados bench -p rbd cleanup
2.2 rbd bench (블록 스토리지 성능)
RBD 이미지 생성 및 테스트
# 테스트용 RBD 이미지 생성
rbd create test-volume --size 10G --pool rbd
# RBD 순차 쓰기 테스트
rbd bench test-volume --io-type write --io-size 4M --io-threads 16 --io-total 1G
# RBD 순차 읽기 테스트
rbd bench test-volume --io-type read --io-size 4M --io-threads 16 --io-total 1G
# RBD 랜덤 쓰기 테스트
rbd bench test-volume --io-type write --io-size 4K --io-threads 16 --io-total 1G --io-pattern rand
# 테스트 완료 후 정리
rbd rm test-volume
2.3 fio를 이용한 상세 성능 테스트
RBD 디바이스 매핑 및 fio 테스트
# RBD 이미지 매핑
rbd map test-volume
# 출력: /dev/rbd0
# fio 설정 파일 생성
cat > rbd-test.fio << EOF
[global]
ioengine=libaio
direct=1
size=1G
runtime=60
group_reporting
[rbd-seq-write]
rw=write
bs=1M
filename=/dev/rbd0
[rbd-seq-read]
rw=read
bs=1M
filename=/dev/rbd0
[rbd-rand-write]
rw=randwrite
bs=4K
filename=/dev/rbd0
[rbd-rand-read]
rw=randread
bs=4K
filename=/dev/rbd0
EOF
# fio 실행
fio rbd-test.fio
# 테스트 완료 후 언매핑
rbd unmap /dev/rbd0
3. 실시간 성능 모니터링
3.1 ceph 내장 모니터링
실시간 통계
# 실시간 OSD 성능 통계
ceph osd perf
# 실시간 클러스터 통계
ceph -w
# 특정 풀 통계
ceph osd pool stats {pool-name}
ceph osd pool stats rbd
PG 상태 모니터링
# PG 상태 확인
ceph pg stat
ceph pg dump
# 특정 풀의 PG 상태
ceph pg ls-by-pool {pool-name}
3.2 성능 카운터 모니터링
OSD 성능 카운터
# OSD 성능 카운터 확인
ceph daemon osd.{id} perf dump
# 특정 카운터 모니터링
ceph daemon osd.{id} perf schema
ceph daemon osd.{id} config show
MON 성능 카운터
# MON 성능 정보
ceph daemon mon.{hostname} perf dump
4. 네트워크 성능 체크
클러스터 네트워크 테스트
# 노드 간 네트워크 지연시간 체크
ceph osd test-network --node {node-name}
# 특정 OSD 간 네트워크 테스트
iperf3 -s # 서버 측
iperf3 -c {server-ip} -t 30 # 클라이언트 측
5. 디스크 I/O 성능 체크
개별 OSD 디스크 성능
# OSD 디스크 사용량 확인
ceph osd df tree
# 특정 OSD의 디스크 I/O 상태
iostat -x 1 10
# 디스크별 성능 테스트
fio --name=test --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=1 --size=1G --numjobs=1 --filename=/dev/sdb
6. 성능 분석 및 최적화
6.1 성능 지표 해석
주요 성능 지표
- IOPS: 초당 입출력 작업 수
- Throughput: 처리량 (MB/s)
- Latency: 지연시간 (ms)
- Utilization: 자원 사용률 (%)
벤치마크 결과 예시
# rados bench 결과 해석
Bandwidth (MB/sec): 150.5
Average IOPS: 37
Stddev IOPS: 8.2
Max IOPS: 52
Min IOPS: 24
Average Latency(s): 0.42
Stddev Latency(s): 0.18
Max latency(s): 1.2
Min latency(s): 0.08
6.2 성능 최적화 팁
OSD 최적화
# OSD 설정 조정
ceph config set osd osd_op_threads 8
ceph config set osd osd_disk_threads 4
ceph config set osd osd_recovery_max_active 3
풀 최적화
# PG 수 조정
ceph osd pool set {pool-name} pg_num 128
ceph osd pool set {pool-name} pgp_num 128
# 복제본 수 설정
ceph osd pool set {pool-name} size 3
ceph osd pool set {pool-name} min_size 2
7. 자동화된 성능 체크 스크립트
성능 체크 스크립트 예시
#!/bin/bash
# ceph-perf-check.sh
echo "=== Ceph Cluster Performance Check ==="
echo "Date: $(date)"
echo
echo "1. Cluster Status:"
ceph -s
echo
echo "2. Cluster Capacity:"
ceph df
echo
echo "3. OSD Performance:"
ceph osd perf
echo
echo "4. Pool Statistics:"
ceph osd pool stats
echo
echo "5. Network Test (30sec):"
timeout 30 rados bench -p rbd 10 write --no-cleanup
echo
echo "6. Cleanup:"
rados bench -p rbd cleanup
echo
echo "Performance check completed!"
실행 방법
chmod +x ceph-perf-check.sh
./ceph-perf-check.sh > perf-report-$(date +%Y%m%d).txt
8. 성능 모니터링 도구 연동
Prometheus + Grafana 연동
# Ceph MGR Prometheus 모듈 활성화
ceph mgr module enable prometheus
# Prometheus 메트릭 확인
curl http://{mgr-node}:9283/metrics
Ceph Dashboard 활성화
# Dashboard 모듈 활성화
ceph mgr module enable dashboard
# Dashboard 접속 설정
ceph dashboard create-self-signed-cert
ceph dashboard ac-user-create admin admin administrator
9. 성능 이슈 트러블슈팅
성능 저하 원인 분석
# 느린 요청 확인
ceph osd log slow-requests
# 복구 작업 확인
ceph -s | grep recovery
# 스크럽 작업 확인
ceph pg dump | grep scrub
성능 개선 조치
# 복구 작업 제한 설정
ceph config set osd osd_recovery_max_active 1
ceph config set osd osd_recovery_op_priority 1
# 스크럽 일정 조정
ceph config set osd osd_scrub_begin_hour 1
ceph config set osd osd_scrub_end_hour 6
이 가이드를 통해 체계적으로 Ceph 클러스터의 성능을 모니터링하고 최적화할 수 있습니다.
'CLOUD' 카테고리의 다른 글
Kolla Ansible 이미지 커스터마이징 및 Docker Hub 배포 가이드 (1) | 2025.06.16 |
---|---|
OpenStack Cinder RBD 강제 종료 후 Disk I/O 문제 해결 가이드 (1) | 2025.06.16 |
OpenStack 인스턴스 스냅샷 vs 볼륨 스냅샷 완벽 가이드 (0) | 2025.06.16 |
Opnestack kolla-ansible 배포 관련 the error was: systemerror: <built-in function _escape_inner> returned null without setting an exception failed 에러 해결 방법 (0) | 2025.05.29 |
OpenStack Designate에 대해 알아보기 (0) | 2025.04.08 |