logstash performance testing
最近一直在和peformance team的同事做logstash 5.6.2的测试,主要测试两个方面:一方面测试log数据是否能全部被logstash获取与发出去,一方面测试logstash自身的cpu和memory的使用情况。
通过脚本生成log:总共生成10个文件,每个文件1百万行文本, 每行字符在100以内,长短不一。采用python多线程生成,总共耗时24分钟左右。
测试server有2个物理CPU,每个物理CPU有6个core, 16g内存。
logstash的output为kafka。
通过logstash的metrics plugin记录经过filter的event数量。
通过在output中配置file {path=>"/tmp/output.log"},把发出去的内容print到一个local文件,用于统计最终发出去了多少条记录。
通过jconsole进行CPU/Memony的统计
总共进行了4轮测试,每轮都能把1千万行log记录完全发送出去,第一方面的测试顺利通过。
主要说说观察到的cpu和memory的使用情况。
第一轮测试(采用logstash默认参数):
Xms1g
Xmx1g
pipeline.workers:12
pipeline.batch.size=125
pipeline.batch.delay=5
结果:
memory usage:

cpu: idle:0.2%, running:3.2%~5.2%. 总共花费了40分钟把log全部传输出去.

JVM使用情况:

JVM KPI:

结论:堆内存的使用一直在增加,但增加的速率并不快,整个过程直到完成都没有触发full GC. cpu在running状态下比较稳定,jvm的throughput > 95%属于比较好的状况。
第二轮测试:增大pipeline.batch.size
Xms1g
Xmx1g
pipeline.workers:12 #default equal total core number 2*6 = 12
pipeline.batch.size=500 # 125=>500
pipeline.batch.delay=5
结果:
memory在200mb~800mb直接不断震动,出现多次full GC。

cpu idle:0.6% running:3%~7%。比之第一轮测试,cpu不是很stable,总共花费了43min中才传输完所有log。

JVM使用情况:

JVM KPI:

结论:因为增大了pipeline.batch.size导致堆内存的增长边开,很快达到了CMS Old Gen GC的上限,所有频繁出现GC。同时导致cpu也没有第一轮测试时稳定。JVM througput < 95%,也没有达到业界的优良标准。最终导致传输所有log所耗时间也增加了,说明并不是batch size越大越好。
第三轮测试:降低pipeline.works
Xms1g
Xmx1g
pipeline.workers:6 # 12 => 6
pipeline.batch.size=500
pipeline.batch.delay=5
memory使用非常低,上升的也很慢。

cpu基本与空闲状态相似,通过metric.log中的数据观察到,平均每5秒大约发送500events,和batch.size设置的大小一致。这个状态要发送完1千万条数据,耗时非常长,所以中间停掉了测试。

JVM使用情况:

JVM KPI:

结论:cpu分配的少,导致内存使用也保持在一个相对较低的水平,jvm kpi虽好,是因为没有重复使用resource。最终导致logstash的工作效率也很低,没能发挥它的全部能力。
第四轮测试:减低分配的JVM内存。
Xms512mb (1g => 512mb)
Xmx512mb (1g => 512mb)
pipeline.workers:12
pipeline.batch.size=125
pipeline.batch.delay=5
Memory使用情况:刚开始需要处理10个文件新创建出来的文件的时候,内存使用比较多。发生了一次CMS Old Gen GC后,后续heap使用平稳上升.

cpu相对比较稳妥,running:3.2% ~ 5.2%。耗时41分钟,发送完所有log。

结论:memory的分配减少了50%,并没有发现logstash的工作效率有明显降低,如果产线内存吃紧,可以大胆选择减少给logstash的内存分配,当然前提是log生产量不是很大的状况下。
logstash performance testing的更多相关文章
- Difference Between Performance Testing, Load Testing and Stress Testing
http://www.softwaretestinghelp.com/what-is-performance-testing-load-testing-stress-testing/ Differen ...
- 脚本语言&& Performance Testing
watin: http://www.cnblogs.com/dahuzizyd/archive/2007/04/13/ruby_on_rails_windows_instatnrails_study_ ...
- Run Performance Testing Which Was Distributed To Multiple Test Agents
How to solve the VS installed machine cannot run performance testing by .testsettings file, which wi ...
- Performance Testing 入门小结
从事软件测试两年多了,一直在做功能测试.2016年计划学习Performance.今天,先把之前听过的同事session以及自己查阅的资料小结一下. 一.什么是性能测试 首先来说一下软件的性能是什么. ...
- Difference between Load / Stress / Performance Testing
Load and stress testing are subsets of performance testing. Performance testing means how best somet ...
- RabbitMQ Performance Testing Tool 性能测试工具
RabbitMQ Performance Testing Tool 介绍:https://www.rabbitmq.com/java-tools.html RabbitMQ Performance T ...
- Performance testing of web application
Testing the performance of web application is easy . It's easy to design unrealistic scenario . Easy ...
- Performance testing test scenarios
1 check if page load time is within acceptable range2 check page load on slow connections 3 check re ...
- Performance Testing
To test application performance, add rules using FiddlerScript to the OnBeforeResponse function (exc ...
随机推荐
- 【34.40%】【codeforces 711D】Directed Roads
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Azure Messaging-ServiceBus Messaging
Azure Messaging-ServiceBus Messaging 上篇博文中我们介绍了Azure Messaging的重复消息机制.At most once 和At least once. A ...
- cordova打包之android应用签名
原文:cordova打包之android应用签名 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/mate_ge/article/details/78 ...
- Android开发之 shape的使用
android shape的使用 shape用于设定形状,能够在selector,layout等里面使用,有6个子标签,各属性例如以下: <?xml version="1.0" ...
- 【转】mysql的SQL_NO_CACHE(在查询时不使用缓存)和sql_cache用法
转自:http://www.169it.com/article/5994930453423417575.html 为了测试sql语句的效率,有时候要不用缓存来查询. 使用 SELECT SQL_NO_ ...
- SQL中的JOIN语法详解
参考以下两篇博客: 第一个是 sql语法:inner join on, left join on, right join on详细使用方法 讲了 inner join, left join, righ ...
- 微信公众平台自定义菜单接口API指南
微信公众平台开发模式自定义菜单接口API指南 简介 开发者获取使用凭证(如何获取凭证)后,可以使用该凭证对公众账号的自定义菜单进行创建.查询和删除等操作. 自定义菜单接口可实现以下类型按钮: clic ...
- VS2005 编译 Qt4.8.2库,并修正源码中的错误
从昨天开始利用VS2005对Qt4.8.2库进行编译,在编译到某个文件时,总是报错,提示VS的cl.exe和nmake.exe返回致命错误.错误罗列如下: DefaultLocalizationStr ...
- C# ini
C# ini文件操作[源码下载] 介绍C#如何对ini文件进行读写操作,C#可以通过调用[kernel32.dll]文件中的 WritePrivateProfileString()和GetPrivat ...
- 构建自己的PHP框架(路由)
完整项目地址:https://github.com/Evai/Aier 上一篇中我们已经建立了一个空的 Composer 项目,本篇将讲述如何构建路由. 下面我们就开始自己来构建路由,先去 GitHu ...