Carry の Blog Carry の Blog
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Carry の Blog

好记性不如烂键盘
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • MySQL

  • Redis

  • Keydb

  • TiDB

  • MongoDB

  • Elasticsearch

    • 安装配置
    • 给Elasticsearch集群添加用户密码
    • Elastichsearch的分片和副本
    • 单节点分片达到默认上限解决办法
    • Elasticsearch集群节点磁盘使用分配不均解决办法
    • Elastichsearch的模板template和映射mapping
    • Elastichsearch查询-分页查询
    • Elasticsearch字符串搜索方式
    • Elastichsearch使用wildcard字段模糊匹配
    • ES数据迁移工具esm
    • Nginx Mirror 模块实现三套ES写入网关
    • ES单机多节点集群docker-compose一键安装
    • tcpdump抓包Elasticsearch语句
    • ElasticSearch 动态模板 使用方法
    • ES打开slowlog记录慢语句
    • ES加速恢复
    • Elasticsearch 常用 DSL 语句
    • Logstash迁移ES数据
  • Kafka

  • victoriametrics

  • BigData

  • Sqlserver

  • 数据库
  • Elasticsearch
Carry の Blog
2023-02-08

ES打开slowlog记录慢语句

# 记录部分慢语句

PUT /_all/_settings
{
    "index.search.slowlog.threshold.query.warn": "5s",
    "index.search.slowlog.threshold.query.info": "2s",
    "index.search.slowlog.threshold.query.debug": "1s",
    "index.search.slowlog.threshold.query.trace": "400ms",
    "index.search.slowlog.threshold.fetch.warn": "1s",
    "index.search.slowlog.threshold.fetch.info": "800ms",
    "index.search.slowlog.threshold.fetch.debug": "500ms",
    "index.search.slowlog.threshold.fetch.trace": "200ms"
}
1
2
3
4
5
6
7
8
9
10
11

# 记录所有语句

PUT /_all/_settings
{
    "index.search.slowlog.threshold.query.warn": "0s",
    "index.search.slowlog.threshold.query.info": "0s",
    "index.search.slowlog.threshold.query.debug": "0s",
    "index.search.slowlog.threshold.query.trace": "0s",

    "index.search.slowlog.threshold.fetch.warn": "0s",
    "index.search.slowlog.threshold.fetch.info": "0s",
    "index.search.slowlog.threshold.fetch.debug": "0s",
    "index.search.slowlog.threshold.fetch.trace": "0s",
    
    "index.indexing.slowlog.threshold.index.warn": "0s",
    "index.indexing.slowlog.threshold.index.info": "0s",
    "index.indexing.slowlog.threshold.index.debug": "0s",
    "index.indexing.slowlog.threshold.index.trace": "0s"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

官方文档 (opens new window)

上次更新: 4/24/2025

← ElasticSearch 动态模板 使用方法 ES加速恢复→

最近更新
01
tidb fast ddl
04-04
02
TiDB配置文件调优 原创
04-03
03
如何移除TiDB中的表分区 原创
04-03
更多文章>
Theme by Vdoing
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式