ElasticSearch之线程池

ElasticSearch节点可用的CPU核的数量,通常可以交给ElasticSearch来自行检测和判定,另外可以在``elasticsearch.yml`中显式指定。样例如下:

node.processors: 2

如下表格中的processors即CPU核的数量。

线程池的列表

线程池名称 类型 线程数量 队列长度 用途
generic scaling 一般用途。
search fixed (processors * 3) / 2 + 1 1000 count/search
search_worker fixed (processors * 3) / 2 + 1 unbounded count/search
search_throttled fixed 1 100 count/search/suggest/get
search_coordination fixed processors / 2 1000 search-related
get fixed (processors * 3) / 2 + 1 1000 get
analyze fixed 1 16 analyze
write fixed processors 10000 index/delete/update, ingest processors, and bulk requests
snapshot scaling min(5, (processors) / 2) snapshot/restore
snapshot_meta scaling min(50, (processors* 3)) snapshot repository metadata read
warmer scaling min(5, processors / 2) segment warm-up
refresh scaling min(10, processors / 2) refresh
fetch_shard_started scaling 2 * processors listing shard states
fetch_shard_store scaling 2 * processors listing shard stores
flush scaling min(5, processors / 2) flush/translog
force_merge fixed max(1, processors / 8) unbounded force merge
management scaling 5 cluster management
system_read fixed min(5, processors / 2) read
system_write fixed min(5, processors / 2) write
system_critical_read fixed min(5, processors / 2) read
system_critical_write fixed min(5, processors / 2) write
watcher fixed min(5 * processors, 50) 1000 watch executions

依据上述表格中的线程数量的规则,通过指定node.processors,可以推断出ElasticSearch各线程池中线程的数量。

线程池的类型

fixed
线程池中的线程数量固定,同时使用队列来缓存当前暂时无法处理的请求。
通过参数size指定线程池中线程的数量。
通过参数queue_size指定请求队列的长度,默认值为-1,表示unbounded,即为无界队列。

配置样例,如下:

thread_pool:
    write:
        size: 30
        queue_size: 1000

scaling
线程池中的线程数量依据一定的规则动态调整。
通过参数coremax,以及工作负载情况来判定线程的生命周期和数量。
通过参数keep_alive来决定空载情况下,线程的存活时长。
配置样例,如下:

thread_pool:
    warmer:
        core: 1
        max: 8
        keep_alive: 2m

相关资料

相关推荐

  1. ElasticSearch线

    2023-12-10 16:24:05       65 阅读
  2. 深入Elasticsearch线的原理与应用

    2023-12-10 16:24:05       58 阅读
  3. C-线

    2023-12-10 16:24:05       39 阅读
  4. 线

    2023-12-10 16:24:05       37 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-10 16:24:05       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-10 16:24:05       106 阅读
  3. 在Django里面运行非项目文件

    2023-12-10 16:24:05       87 阅读
  4. Python语言-面向对象

    2023-12-10 16:24:05       96 阅读

热门阅读

  1. HIVE学习(hive基础)

    2023-12-10 16:24:05       60 阅读
  2. React富文本编辑器wangEditor

    2023-12-10 16:24:05       64 阅读
  3. 12.9每日一题(备战蓝桥杯循环结构)

    2023-12-10 16:24:05       42 阅读
  4. 力扣-151. 反转字符串中的单词

    2023-12-10 16:24:05       67 阅读
  5. 聊聊spring.mvc.servlet.load-on-startup

    2023-12-10 16:24:05       51 阅读
  6. HarmonyOS--ArkTS(1)--基本语法(2)

    2023-12-10 16:24:05       63 阅读
  7. K8S学习指南(3)-minikube的安装

    2023-12-10 16:24:05       50 阅读