DBAtlas · 데이터베이스 운영 아틀라스

search 및 indexing slow log 활성화 (인덱스별 임계값)

Elasticsearch성능

명령어

PUT musteri/_settings
{
  "index.search.slowlog.threshold.query.warn": "2s",
  "index.search.slowlog.threshold.query.info": "500ms",
  "index.search.slowlog.threshold.fetch.warn": "1s",
  "index.indexing.slowlog.threshold.index.warn": "1s",
  "index.indexing.slowlog.source": "200"
}
GET musteri/_settings/index.*slowlog*?flat_settings=true
# Set thresholds to null to turn it off:
PUT musteri/_settings
{
  "index.search.slowlog.threshold.query.warn": null,
  "index.search.slowlog.threshold.query.info": null,
  "index.search.slowlog.threshold.fetch.warn": null,
  "index.indexing.slowlog.threshold.index.warn": null,
  "index.indexing.slowlog.source": null
}

하는 일

지정한 인덱스에 대해 query 및 fetch 단계와 indexing에서 임계값을 넘는 요청을 쿼리 body와 함께 slow log에 기록한다.

사용 시점

어떤 쿼리가 느린 search를 일으키는지 찾거나, 특정 대시보드나 클라이언트의 무거운 쿼리를 잡기 위해.

주의

임계값은 샤드별로 측정된다: shard가 많은 인덱스에서는 각 샤드가 자신의 줄을 기록할 수 있다. 매우 낮은 임계값(0ms)은 로그량과 IO를 크게 늘리므로 진단 후 null로 끈다. indexing.slowlog.source는 문서 source를 로그에 기록하므로 민감 데이터가 있으면 false로 설정한다. 설정은 지정한 인덱스에만 적용되므로 새 인덱스를 위해 템플릿에 추가한다.

DBAtlas에서 열기 →

관련 항목