Easysearch 性能测试方法概要

news/2024/11/14 16:58:50/文章来源:https://www.cnblogs.com/infinilabs/p/18379868

INFINI Easysearch

INFINI Easysearch 是一个分布式的近实时搜索与分析引擎,核心引擎基于开源的 Apache Lucene。Easysearch 衍生自基于开源协议 Apache 2.0 的 Elasticsearch 7.10 版本,完善和支持更多的企业级功能,优化搜索业务场景,以保证更佳的数据探索与分析体验。

Easysearch 的主要特点:

  • 兼容 Elasticsearch,业务代码无需改动;可平滑迁移
  • 企业级安全;更稳定可靠
  • 企业级管理后台(多集群统一管理,实现运营标准化、自动化)
  • 信创适配(全面适配国产 CPU/OS/服务器,支持国密算法)
  • Easysearch 快速体验,请参阅:

Easysearch,地表最强,没有之一!

Loadgen

Loadgen 是 Elasticsearch 专属压测工具,用来对 Easysearch 或者网关进行压力测试。

Loadgen 的特点:

  • 性能强劲
  • 轻量级无依赖
  • 支持模板化参数随机
  • 支持高并发
  • 支持压测端均衡流量控制
  • 支持服务端返回值校验

当前最新版本为 1.26.1-598,下载链接如下:

https://release.infinilabs.com/loadgen/stable/

下载并解压安装包后,得到二进制文件。

查看版本信息。

$ ./loadgen-linux-amd64 -v__   ___  _      ___  ___   __    __/ /  /___\/_\    /   \/ _ \ /__\/\ \ \/ /  //  ///_\\  / /\ / /_\//_\ /  \/ /
/ /__/ \_//  _  \/ /_// /_\\//__/ /\  /
\____|___/\_/ \_/___,'\____/\__/\_\ \/[LOADGEN] A http load generator and testing suite.
[LOADGEN] 1.26.1#598, 2024-08-14 04:50:03, 2024-12-31 10:10:10, 00f15fd86834d7ea539f6d66ee608e3915eef0e3
loadgen 1.26.1 598 2024-08-14 04:50:03 +0000 UTC 2024-12-31 10:10:10 +0000 UTC 00f15fd86834d7ea539f6d66ee608e3915eef0e3

Loadgen 测试

Loadgen 使用非常简单,下面演示如何进行查询压测。

  1. 建立索引,根据节点数调节分片数。
curl -X PUT -H "Content-Type: application/json" \
-ku admin:xxx "https://localhost:9200/loadtest" -d'
{"settings":{"number_of_shards":"3","number_of_replicas":1,"translog":{"durability":"async"}}
}'
{"acknowledged":true,"shards_acknowledged":true,"index":"loadtest"}
  1. 创建 loadgen.dsl.shawnyan 配置文件,定义查询
GET loadtest/_search
{"query": {"term": {"id.keyword": {"value": $[[id]]}}}}
  1. 执行压测,-d 表示秒数,-c 表示并发数。
$ ES_ENDPOINT=https://localhost:9200 ES_USERNAME=admin ES_PASSWORD=xxx ./loadgen-linux-amd64 -run loadgen.dsl.shawnyan -d 10 -c 2__   ___  _      ___  ___   __    __/ /  /___\/_\    /   \/ _ \ /__\/\ \ \/ /  //  ///_\\  / /\ / /_\//_\ /  \/ /
/ /__/ \_//  _  \/ /_// /_\\//__/ /\  /
\____|___/\_/ \_/___,'\____/\__/\_\ \/[LOADGEN] A http load generator and testing suite.
[LOADGEN] 1.26.1#598, 2024-08-14 04:50:03, 2024-12-31 10:10:10, 00f15fd86834d7ea539f6d66ee608e3915eef0e3
[08-19 16:43:27] [INF] [env.go:179] configuration auto reload enabled
[08-19 16:43:27] [INF] [app.go:285] initializing loadgen, pid: 30792
[08-19 16:43:27] [INF] [app.go:286] using config: /data/es/loadgen.yml
[08-19 16:43:27] [INF] [module.go:155] started plugin: statsd
[08-19 16:43:27] [INF] [module.go:161] all modules are started
[08-19 16:43:27] [INF] [instance.go:78] workspace: /data/es/data/loadgen/nodes/cr1gabqr90cng685o2s0
[08-19 16:43:27] [INF] [app.go:511] loadgen is up and running now.
[08-19 16:43:27] [INF] [main.go:403] loading config: /data/es/loadgen.dsl.shawnyan21108 requests finished in 9.79061677s, 1.08MB sent, 3.22MB received[Loadgen Client Metrics]
Requests/sec:           2110.63
Request Traffic/sec:    110.22KB
Total Transfer/sec:     440.00KB
Fastest Request:        680.198µs
Slowest Request:        12.409574ms
Status 200:             21108[Latency Metrics]
10000 samples of 21108 events
Cumulative:     8.732205871s
HMean:          851.869µs
Avg.:           873.22µs
p50:            839.498µs
p75:            914.298µs
p95:            1.059197ms
p99:            1.327098ms
p999:           4.83579ms
Long 5%:        1.394411ms
Short 5%:       724.226µs
Max:            11.618475ms
Min:            680.198µs
Range:          10.938277ms
StdDev:         289.216µs
Rate/sec.:      2110.63[Latency Distribution]680µs - 1.774ms ------------------------------1.774ms - 2.867ms -2.867ms - 3.961ms -3.961ms - 5.055ms -5.055ms - 6.149ms -6.149ms - 7.243ms -7.243ms - 8.336ms -8.336ms - 9.43ms -9.43ms - 10.524ms -10.524ms - 11.618ms -[Estimated Server Metrics]
Requests/sec:           2155.94
Avg Req Time:           927.668µs
Transfer/sec:           449.45KB

更多内容请参阅文档:

https://infinilabs.cn/docs/latest/gateway/getting-started/benchmark/

Rally

如果对 Elasticsearch 熟悉的同学,也可尝试使用 Rally 对 Easysearch 进行测试。

Rally 是 Elasticsearch 的基准测试框架。它可以帮助您完成以下任务:

  • 安装 Elasticsearch 集群以进行基准测试
  • 跨 Elasticsearch 版本管理基准数据和规范
  • 运行基准测试并记录结果
  • 通过连接遥测设备来查找性能问题
  • 比较性能结果

安装 Rally。

[root@easysearch /]# pip3 install esrally
Requirement already satisfied: esrally in /usr/local/lib/python3.9/site-packages (2.11.0)
Requirement already satisfied: py-cpuinfo==7.0.0 in /usr/local/lib/python3.9/site-packages (from esrally) (7.0.0)
Requirement already satisfied: elastic-transport==8.4.1 in /usr/local/lib/python3.9/site-packages (from esrally) (8.4.1)
Requirement already satisfied: google-resumable-media[requests]==1.1.0 in /usr/local/lib/python3.9/site-packages (from esrally) (1.1.0)
Requirement already satisfied: urllib3==1.26.18 in /usr/local/lib/python3.9/site-packages (from esrally) (1.26.18)
Requirement already satisfied: google-auth==1.22.1 in /usr/local/lib/python3.9/site-packages (from esrally) (1.22.1)
Requirement already satisfied: thespian==3.10.1 in /usr/local/lib/python3.9/site-packages (from esrally) (3.10.1)
Requirement already satisfied: jsonschema==3.1.1 in /usr/local/lib/python3.9/site-packages (from esrally) (3.1.1)
Requirement already satisfied: markupsafe==2.0.1 in /usr/local/lib64/python3.9/site-packages (from esrally) (2.0.1)
Requirement already satisfied: yappi==1.5.1 in /usr/local/lib64/python3.9/site-packages (from esrally) (1.5.1)
Requirement already satisfied: psutil==5.9.4 in /usr/local/lib64/python3.9/site-packages (from esrally) (5.9.4)
Requirement already satisfied: certifi in /usr/local/lib/python3.9/site-packages (from esrally) (2024.7.4)
Requirement already satisfied: elasticsearch[async]==8.6.1 in /usr/local/lib/python3.9/site-packages (from esrally) (8.6.1)
Requirement already satisfied: ijson==2.6.1 in /usr/local/lib/python3.9/site-packages (from esrally) (2.6.1)
Requirement already satisfied: jinja2==3.1.4 in /usr/local/lib/python3.9/site-packages (from esrally) (3.1.4)
Requirement already satisfied: requests<2.32.0 in /usr/local/lib/python3.9/site-packages (from esrally) (2.31.0)
Requirement already satisfied: tabulate==0.8.9 in /usr/local/lib/python3.9/site-packages (from esrally) (0.8.9)
Requirement already satisfied: zstandard==0.21.0 in /usr/local/lib64/python3.9/site-packages (from esrally) (0.21.0)
Requirement already satisfied: docker==6.0.0 in /usr/local/lib/python3.9/site-packages (from esrally) (6.0.0)
Requirement already satisfied: websocket-client>=0.32.0 in /usr/local/lib/python3.9/site-packages (from docker==6.0.0->esrally) (1.8.0)
Requirement already satisfied: packaging>=14.0 in /usr/lib/python3.9/site-packages (from docker==6.0.0->esrally) (20.9)
Requirement already satisfied: aiohttp<4,>=3 in /usr/local/lib64/python3.9/site-packages (from elasticsearch[async]==8.6.1->esrally) (3.10.4)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.9/site-packages (from google-auth==1.22.1->esrally) (0.4.0)
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3.9/site-packages (from google-auth==1.22.1->esrally) (1.15.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.9/site-packages (from google-auth==1.22.1->esrally) (4.9)
Requirement already satisfied: setuptools>=40.3.0 in /usr/lib/python3.9/site-packages (from google-auth==1.22.1->esrally) (53.0.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.9/site-packages (from google-auth==1.22.1->esrally) (4.2.4)
Requirement already satisfied: google-crc32c<2.0dev,>=1.0 in /usr/local/lib64/python3.9/site-packages (from google-resumable-media[requests]==1.1.0->esrally) (1.5.0)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.9/site-packages (from jsonschema==3.1.1->esrally) (24.2.0)
Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.9/site-packages (from jsonschema==3.1.1->esrally) (8.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib64/python3.9/site-packages (from jsonschema==3.1.1->esrally) (0.20.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib64/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (1.9.4)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib64/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (1.4.1)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (1.3.1)
Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (4.0.3)
Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (2.3.7)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib64/python3.9/site-packages (from aiohttp<4,>=3->elasticsearch[async]==8.6.1->esrally) (6.0.5)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/lib/python3.9/site-packages (from packaging>=14.0->docker==6.0.0->esrally) (2.4.7)
Requirement already satisfied: pyasn1<0.7.0,>=0.4.6 in /usr/local/lib/python3.9/site-packages (from pyasn1-modules>=0.2.1->google-auth==1.22.1->esrally) (0.6.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests<2.32.0->esrally) (3.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib64/python3.9/site-packages (from requests<2.32.0->esrally) (3.3.2)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.9/site-packages (from importlib-metadata->jsonschema==3.1.1->esrally) (3.20.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@easysearch /]# esrally --version
esrally 2.11.0
[root@easysearch /]#

关于 Rally 的更多内容,请参阅官方文档:

https://esrally.readthedocs.io/en/stable/

作者:少安事务所
原文:https://mp.weixin.qq.com/s/9eEH38kgsw4i150CJqyxvQ

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/787348.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

简单的内存取证

记录一次内存取证;练习还是学到了很多东西!继续加油!工具: volatility2.6 + gimp 使用插件 mimikatz 看看账户和密码 python2 vol.py --plugins=/plugins/ -f baby_misc.raw --profile=Win7SP1x64 mimikatz​​ 然后再使用 filescan 插件扫描一下可疑的文件 python2 vol.py…

【复习失败-bp出问题了】【漏洞复现】DouPHP(CVE-2024-7917、代码分析xss)漏洞复现

https://mp.weixin.qq.com/s/YccEe85xFiZIZGOPQLABkA DouPHP(CVE-2024-7917、代码分析xss)漏洞复现 原创 LULU 红队蓝军 2024年08月23日 18:01 四川 漏洞介绍 漏洞:CVE-2024-7917 介绍:DouPHP 1.7_Release_20220822版本中存在一个远程代码执行(RCE)漏洞。拥有管理员权限的…

【简易学生管理系统】java版(内附完整源码)

源代码附在文章末尾注意:代码中定义了Student和User两个类,最初的登录操作对应User,之后才是对Student信息的增删改查。代码中对大部分用户键入都进行了校验,校验规则如下 用户名: 长度在3~15位 只能是数字和字母的组合不能都是数字 用户名已存在,无法注册手机号: 长度1…

[Datawhale AI 夏令营] Task1: 跑通YOLO方案baseline

环境配置厚德云 RTX 4090 image-gpu-pytorch_20240807运行 apt install git-lfs git lfs install git clone https://www.modelscope.cn/datasets/Datawhale/AI_Camp5_baseline_CV.git提交结果

如何快速对影像进行分幅?

GIS数据转换器的"分割转换"功能,可以根据用户设定的像素大小将一幅大影像分割成若干小尺寸的影像。下面是详细的使用步骤:方法/步骤1. 数据准备支持tif、img、bmp文件格式。 2. 软件下载与安装从GeoSaaS.COM官网下载并安装 GIS数据转换器,安装完成后桌面上出现”G…

dpdk解析报文协议-基于l2fwd

dpdk解析报文协议-基于l2fwd 0 前置条件 1、这里需要两台虚拟机,配置了相同的虚拟网络,可以通过tcpreplay在一台虚拟机回放报文,在另一台虚拟机通过tcpdump -i 网卡名 捕获到。具体配置可参考https://www.jb51.net/server/2946942fw.htm2、需要dpdk环境配置完成 3、大致了解…

引用类型和值类型(一)

引用类型和值类型(一) 关于引用类型和值类型的区别经常听到这样一个说法:“值类型分配在栈上,引用类型分配在堆上”。这个回答并不完全正确,或者说这不是值类型和应用类型真正的差别。官方文档给出的定义:引用类型的变量存储对其数据(对象)的引用,而值类型的变量直接包…

修改SpringBoot的配置文件application.yaml后启动失败

经常碰到修改application.yaml文件之后,SpringBoot项目启动失败的,报错信息如下 Connected to the target VM, address: 127.0.0.1:7105, transport: socket 21:12:59.122 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - App…

mac 隐藏文件显示 快捷键

用户》macmac 是电脑自己的名字

【信息收集】 SSH指纹

原创 儒道易行一、 SSH指纹 首次通过SSH连接一台服务器时,SSH服务返回其指纹信息,如果确认指纹信息无误,该指纹将保存到~/.ssh/know_hosts中, 服务器IP与指纹一一对应;第二次访问SSH服务时,SSH客户端将对比返回的指纹与~/.ssh/know_hosts是否一致,一致就顺利连接,否则警…

yml文件中使用profile配置切换多环境

pom.xml<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.…

京东面试:600Wqps高并发ID如何设计?时钟回拨 如何解决?

文章很长,且持续更新,建议收藏起来,慢慢读!疯狂创客圈总目录 博客园版 为您奉上珍贵的学习资源 : 免费赠送 :《尼恩Java面试宝典》 持续更新+ 史上最全 + 面试必备 2000页+ 面试必备 + 大厂必备 +涨薪必备 免费赠送 :《尼恩技术圣经+高并发系列PDF》 ,帮你 实现技术自由,…