最近一直在和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的更多相关文章

  1. Difference Between Performance Testing, Load Testing and Stress Testing

    http://www.softwaretestinghelp.com/what-is-performance-testing-load-testing-stress-testing/ Differen ...

  2. 脚本语言&& Performance Testing

    watin: http://www.cnblogs.com/dahuzizyd/archive/2007/04/13/ruby_on_rails_windows_instatnrails_study_ ...

  3. 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 ...

  4. Performance Testing 入门小结

    从事软件测试两年多了,一直在做功能测试.2016年计划学习Performance.今天,先把之前听过的同事session以及自己查阅的资料小结一下. 一.什么是性能测试 首先来说一下软件的性能是什么. ...

  5. Difference between Load / Stress / Performance Testing

    Load and stress testing are subsets of performance testing. Performance testing means how best somet ...

  6. RabbitMQ Performance Testing Tool 性能测试工具

    RabbitMQ Performance Testing Tool 介绍:https://www.rabbitmq.com/java-tools.html RabbitMQ Performance T ...

  7. Performance testing of web application

    Testing the performance of web application is easy . It's easy to design unrealistic scenario . Easy ...

  8. Performance testing test scenarios

    1 check if page load time is within acceptable range2 check page load on slow connections 3 check re ...

  9. Performance Testing

    To test application performance, add rules using FiddlerScript to the OnBeforeResponse function (exc ...

随机推荐

  1. Method for sub-pixel texture mapping and filtering

    BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for ...

  2. WPF 开发自动开机启动程序

    原文:WPF 开发自动开机启动程序 本文告诉大家如何在 WPF 开发一个可以自动启动的程序 本文使用的自动开机启动方法是通过快捷方式放在启动文件夹的方式. 创建快捷方式 /// <summary ...

  3. 从vue1迁移到vue2踩到的两个坑

    先说第一个,在vue1中用v-for的时候,习惯性用$index和$key来取键.今天迁移到vue2之前,也知道vue2里不能这样用了,结果还是出问题了, 数据渲染不出来. <li v-for= ...

  4. Managing remote devices

    A method and apparatus for managing remote devices. In one embodiment of the present invention, ther ...

  5. mod_timer函数及其他定时器函数

    当一个定时器已经被插入到内核动态定时器链表中后,我们还能够改动该定时器的expires值.函数mod_timer()实现这一点 改动注冊入计时器列表的handler的起动时间 int mod_time ...

  6. Java 中override、overload、overwrite区别,以及与多态的关系【转】

    因为早期的翻译导致了override和overwrite的解释及理解混乱,需要重新梳理这几个词及相关内容. 转自:http://blog.csdn.net/lzhang007/article/deta ...

  7. [C 语言]判断某文件是文件夹还是文件

    #include <sys/stat.h> #include <stdio.h> int _tmain(int argc, _TCHAR* argv[]){ char* fil ...

  8. 随机森林与 GBDT

    随机森林(random forest),GBDT(Gradient Boosting Decision Tree),前者中的森林,与后者中的 Boosting 都在说明,两种模型其实都是一种集成学习( ...

  9. &lt;PC&gt;HP网络共享并创建一个热点问题

    郁闷了一年多 你不能使用本地连接的开放热点 网上说的网卡驱动程序,系统设置等.,我们解决不了 原本BIOS节能设置错误 导致在连续主动对自己的有线无线功能被禁用 该LAN\WLAN  Switchin ...

  10. QProcess::startDetached(5.10有了一种新的方式)

    From Qt 5.10 on, there is a new way how to start detached processes with QProcess. Of course you kno ...