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

相关资料

ElasticSearch之线程池的更多相关文章

  1. elasticsearch高级配置之(二)----线程池设置

    elasticsearch 配置 线程池  一个Elasticsearch节点会有多个线程池,但重要的是下面四个:  索引(index):主要是索引数据和删除数据操作(默认是cached类型)  搜索 ...

  2. 探究ElasticSearch中的线程池实现

    探究ElasticSearch中的线程池实现 ElasticSearch里面各种操作都是基于线程池+回调实现的,所以这篇文章记录一下java.util.concurrent涉及线程池实现和Elasti ...

  3. Elasticsearch源码分析—线程池(十一) ——就是从队列里处理请求

    Elasticsearch源码分析—线程池(十一) 转自:https://www.felayman.com/articles/2017/11/10/1510291570687.html 线程池 每个节 ...

  4. elasticsearch高级配置二----线程池设置

    一个Elasticsearch节点会有多个线程池,但重要的是下面四个: 索引(index):主要是索引数据和删除数据操作(默认是cached类型) 搜索(search):主要是获取,统计和搜索操作(默 ...

  5. elasticsearch 5.x 系列之二 线程池的设置

    1,概述 每个Elasticsearch节点内部都维护着多个线程池,如index.search.get.bulk等,用户可以修改线程池的类型和大小,以及其他的比如reflesh, flush,warm ...

  6. ElasticSearch 线程池类型分析之SizeBlockingQueue

    ElasticSearch 线程池类型分析之SizeBlockingQueue 尽管前面写好几篇ES线程池分析的文章(见文末参考链接),但都不太满意.但从ES的线程池中了解到了不少JAVA线程池的使用 ...

  7. ElasticSearch 线程池类型分析之 ExecutorScalingQueue

    ElasticSearch 线程池类型分析之 ExecutorScalingQueue 在ElasticSearch 线程池类型分析之SizeBlockingQueue这篇文章中分析了ES的fixed ...

  8. ElasticSearch 线程池类型分析之 ResizableBlockingQueue

    ElasticSearch 线程池类型分析之 ResizableBlockingQueue 在上一篇文章 ElasticSearch 线程池类型分析之 ExecutorScalingQueue的末尾, ...

  9. EsRejectedExecutionException排错与线程池类型

    1.EsRejectedExecutionException异常示例 java.util.concurrent.ExecutionException: RemoteTransportException ...

  10. ES线程池

    每个Elasticsearch节点内部都维护着多个线程池,如index.search.get.bulk等,用户可以修改线程池的类型和大小,线程池默认大小跟CPU逻辑一致 一.查看当前线程组状态 cur ...

随机推荐

  1. 《最新出炉》系列初窥篇-Python+Playwright自动化测试-16-处理模态对话框弹窗

    1.简介 我们在日常工作中,会经常遇到弹出警告框的问题,弹框无法绕过,必须处理才可以执行后续的测试,所以弹框处理也是我们必须掌握的一个知识.宏哥在java+selenium系列文章中介绍过这部分内容. ...

  2. Java 21的StringBuilder和StringBuffer新增了一个repeat方法

    发现Java 21的StringBuilder和StringBuffer中多了repeat方法: /** * @throws IllegalArgumentException {@inheritDoc ...

  3. 给定3个整数a、b、c,计算表达式(a+b)/c的值,/是整除运算。[无解]

    题目4-2:给定3个整数a.b.c,计算表达式(a+b)/c的值,/是整除运算. 给定3个整数a.b.c,计算表达式(a+b)/c的值,/是整除运算. 输入格式:输入仅一行,包括三个 整数a.b.c, ...

  4. SharedPreferences-PreferenceUtils

    SharedPreferences   easy use import android.content.Context; import android.content.SharedPreference ...

  5. [AHOI2002] Kitty猫基因突变

    我们不妨将所有权值打到一棵树上,这很容易想到. 考虑暴力,如果我们选择了 \(w\) 个点,修改后我们会从叶子节点依次合并去计算贡献. 很显然我们可以动态规划维护. \(f[p][w][0/1/2]\ ...

  6. 轻松掌握组件启动之Redis单机、主从、哨兵、集群配置

    单机配置启动 Redis安装 下载地址:http://redis.io/download 安装步骤: 1: 安装gcc编译器:yum install gcc 2: 将下载好的redis‐5.0.3.t ...

  7. 2023年SWPU NSS 秋季招新赛 (校外赛道)WP—Crypto

    一.Caesar_base 题目信息 s = "HIJKLMNOPQRSTUVWXYZABCDEFGhijklmnopqrstuvwxyzabcdefg0123456789+/" ...

  8. spring-boot集成hikari多数据源

    maven依赖 <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</ ...

  9. html-7(JavaScript-1)

    放在函数里面 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <ti ...

  10. SpringBoot+Redis实现接口级别缓存信息

    本文主要讲述如何通过SpringBoot+Redis实现接口级别缓存信息 背景 近期因为一直在处理公司的老项目,恰好碰到产品说页面有一些信息展示慢,简单看了一下页面接口,发现查询的是系统中几张大表(数 ...