Cassandra OOM 발생 원인 분석

개발 공부 일지·2021년 9월 24일
0

카산드라를 버전 업 (3.0)하면서,
memtable_allocation_type을 offheap-buffers로 변경했다.

  • 특정 테이블의 특정 컬럼 타입을 frozen -> array<map<~>>로 변경
    -> 이게 좀 치명적인 문제였음.
  • memtable_allocation_type
    1) offheap-buffers : only the membtable buffers offheap
    2) offheap_objects : both the memtable buffers and raise the heap size
    3) heap_buffers

    이 중 offheap_buffers가 CPU 사용량 적고, 쓰기 지연이 적고, 평균 응답시간이 적어서 채택했다

  1. 환경 구성 : 총 5개의 서버로 링 구조를 구성해놓았고, replication-factor는 3으로 설정

  2. 현상 : 1,3번 노드는 문제 없었으나, 2,4,5 노드가 allocate fail, off-heap OOM 발생
    -> cassandra write 과정에서 offheap을 사용하는 부분에서 어떤 과정들이 있는 지 조사했다.
    -> 요청 자체가 OOM이 날 정도로 많은 상황은 아니었다.

  3. write 과정 중, offheap을 사용하는 과정
    1) Memtable

    • memory에 data가 올라와 있는지 확인하고, 관리하는 table

    2) Bloom filter

    • Disk의 SSTable에 Access 하기 전에 Row data가 Memtable에 있는 지 확인하는 memory 구조

    3) Index summary

    4) Compression meta data

profile
알고리즘 / 기술 스택 / CS

0개의 댓글