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 ...
随机推荐
- Spring Boot 定制与优化内置的Tomcat容器
1.Spring Boot定制与优化内置Tomcat容器. > 内置的容器有三个分别是Undertow.Jetty.Tomcat,Spring Boot 对这三个容器分别进行了实现,它们上层接口 ...
- FreeBSD 5.0中强制访问控制机制的使用与源代码分析【转】
本文主要讲述FreeBSD 5.0操作系统中新增的重要安全机制,即强制访问控制机制(MAC)的使用与源代码分析,主要包括强制访问控制框架及多级安全(MLS)策略两部分内容.这一部分讲述要将MAC框架与 ...
- mongoose ObjectId.toString()
node中一般我们经常对id进行判断,有的id是string类型,有的是ObjectId(''),这时候就可以使用mongoose的toString方法,将它转换成string
- 将git文件挂到cdn上
网址:http://raw.githack.com/
- node lesson3
var express = require('express'); var superagent = require('superagent'); var cheerio = require('che ...
- Linux下快速静态编译Qt以及Qt动态/静态版本共存(提供了编译4.6,5.6的精通编译脚本,并且apt-get install 需要的库也全列出来了。还有分析问题的心理过程)good
qt4.6 Linux./configure -static -release -confirm-license -opensource -qt-zlib -qt-libpng -qt-libjpeg ...
- MySQL复制slave服务器死锁案例
原文:MySQL复制slave服务器死锁案例 MySQL复制刚刚触发了一个bug,该bug的触发条件是slave上Xtrabackup备份的时候执行flushs tables with read lo ...
- modern-cpp-features
C++17/14/11 Overview Many of these descriptions and examples come from various resources (see Acknow ...
- Qt on Android 资源文件系统qrc与assets
使用 Qt 为 Android 开发应用时,有时我们的应用会携带一些资源文件,如 png . jpg 等,也可能有一些配置文件,如 xml 等,这些文件放在哪里呢?有两种方式:qrc和assets,咱 ...
- python 教程 第二十二章、 其它应用
第二十二章. 其它应用 1) Web服务 ##代码 s 000063.SZ ##开盘 o 26.60 ##最高 h 27.05 ##最低 g 26.52 ##最新 l1 26.66 ##涨跌 c ...