首页 \ 问答 \ Jmeter瓶颈(Jmeter bottleneck)

Jmeter瓶颈(Jmeter bottleneck)

我们有一个使用Jmeter测试的系统。 我们在Jmeter加速测试中遇到以下瓶颈:

症状:

  • 我们每秒最多可以达到15个请求(rps)。
  • 此限制是每个Java VM,而不是每台计算机。
  • CPU不在极限,仅在ca. 30%。 该测试与请求一起进行了一些预处理和后处理,所以这可能是一个问题,但不是。
  • 内存(带有3.5 GiB的计算机)在ca。 70% - 80%。 这足以让rps略高,所以这不是限制。
  • 内存(JVM)已根据建议进行设置,并且对其进行了各种尝试,但没有任何改进。
  • 我也检查了TCP连接,从“使用保持活动”变为“不使用保持活动”并没有改善任何东西(不是预期的)。
  • 所有(!)断言都被关闭。
  • 日志记录:仅记录响应时间,响应时间百分比,吞吐量和请求率,以及jmeter的标准表输出。
  • 所有日志文件都保存到本地硬盘。

Jmeter通过jmeter.bat脚本启动,其中包含JVM的以下设置:

set HEAP=-Xms768m -Xmx768m -Xss128k
set NEW=-XX:NewSize=256m -XX:MaxNewSize=256m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=256m -XX:MaxPermSize=256m
set DUMP=-XX:+HeapDumpOnOutOfMemoryError
set DDRAW=
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DDRAW% %JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

jmeter.properties具有以下内容:

language=en
cookies=cookies
xml.parser=org.apache.xerces.parsers.SAXParser
jmeter.laf.mac=System
jmeter.loggerpanel.maxlength=5000
not_in_menu=HTML Parameter Mask,HTTP User Parameter Modifier
remote_hosts=127.0.0.1
log_level.jmeter=ERROR
log_level.jmeter.junit=ERROR
log_level.jorphan=WARN
log_file='c:\\temp\\jmeter_'yyyyMMdd'.log'
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss
jmeter.save.saveservice.base_prefix=~/
sampleresult.timestamp.start=true
upgrade_properties=/bin/upgrade.properties
HTTPResponse.parsers=htmlParser wmlParser
htmlParser.types=text/html application/xhtml+xml application/xml text/xml
wmlParser.className=org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
wmlParser.types=text/vnd.wap.wml
summariser.interval=180
summariser.log=true
summariser.out=true
beanshell.server.file=../extras/startup.bsh
time.YMDHMS=yyyyMMdd_HHmmss
onload.expandtree=true
view.results.tree.max_size=0
classfinder.functions.contain=.functions.
classfinder.functions.notContain=.gui.
user.properties=user.properties
system.properties=system.properties   

jmx ,指定了以下设置:

<stringProp name="ThreadGroup.num_threads">300</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<longProp name="ThreadGroup.start_time">1404986400000</longProp>
<longProp name="ThreadGroup.end_time">1404990000000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration">3600</stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
<boolProp name="ThreadGroup.delayedStart">true</boolProp>

问题 :瓶颈在哪里,我们如何摆脱它?


We have a system which we are testing using Jmeter. We experience the following bottleneck in our Jmeter ramp-up test:

Symptoms:

  • We reach a maximum of 15 requests per second (rps).
  • This limit is per Java VM, not per computer.
  • CPU is not at its limit, only at ca. 30%. The test does quite some pre- and post-processing together with the requests, so this could have been a problem, but isn’t.
  • Memory (computer with 3.5 GiB) is at ca. 70% - 80%. This is sufficient to go somewhat higher with the rps, so this is not the limit.
  • Memory (JVM) has been set according to the recommendations, and also been varied to experiment with it, but no improvement.
  • I also checked the TCP connections, a change from “use keep-alive” to “don’t use keep-alive” hasn’t improved anything (was not to be expected).
  • All(!) assertions are switched off.
  • Logging: Only response times, response times percentiles, throughput, and request rate are logged, together with the standard table output of jmeter.
  • All log files are saved to the local hard disk.

Jmeter is started over a jmeter.bat script with thefollowing settings for the JVM:

set HEAP=-Xms768m -Xmx768m -Xss128k
set NEW=-XX:NewSize=256m -XX:MaxNewSize=256m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=256m -XX:MaxPermSize=256m
set DUMP=-XX:+HeapDumpOnOutOfMemoryError
set DDRAW=
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DDRAW% %JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

jmeter.properties has the following content:

language=en
cookies=cookies
xml.parser=org.apache.xerces.parsers.SAXParser
jmeter.laf.mac=System
jmeter.loggerpanel.maxlength=5000
not_in_menu=HTML Parameter Mask,HTTP User Parameter Modifier
remote_hosts=127.0.0.1
log_level.jmeter=ERROR
log_level.jmeter.junit=ERROR
log_level.jorphan=WARN
log_file='c:\\temp\\jmeter_'yyyyMMdd'.log'
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss
jmeter.save.saveservice.base_prefix=~/
sampleresult.timestamp.start=true
upgrade_properties=/bin/upgrade.properties
HTTPResponse.parsers=htmlParser wmlParser
htmlParser.types=text/html application/xhtml+xml application/xml text/xml
wmlParser.className=org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
wmlParser.types=text/vnd.wap.wml
summariser.interval=180
summariser.log=true
summariser.out=true
beanshell.server.file=../extras/startup.bsh
time.YMDHMS=yyyyMMdd_HHmmss
onload.expandtree=true
view.results.tree.max_size=0
classfinder.functions.contain=.functions.
classfinder.functions.notContain=.gui.
user.properties=user.properties
system.properties=system.properties   

At the jmx the following settings have been specified:

<stringProp name="ThreadGroup.num_threads">300</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<longProp name="ThreadGroup.start_time">1404986400000</longProp>
<longProp name="ThreadGroup.end_time">1404990000000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration">3600</stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
<boolProp name="ThreadGroup.delayedStart">true</boolProp>

Question: Where is the bottleneck, and how can we get rid of it?


原文:https://stackoverflow.com/questions/30866466
更新时间:2022-05-21 15:05

最满意答案

你错过了很多东西,我很乐意向你解释。

  1. 这里

    def total_number_of_comments 
     @article = Article.all
     @comments_total = @article.comments.count
    end
    

    你必须这样做

    def total_number_of_comments 
        @comments_total = Comment.all.count // simple solution  
    end
    
  2. 接下来,您没有使用适当的实例变量。

     def total_number_of_articles
        @articles_total = Article.total_number_of_articles
     end
    

    看你自己

    文章总数:

    <%= @total_number_of_articles %> // this is wrong
    

    您指定了@articles_total但使用了@total_number_of_articles 。 如果你使用@articles_total它会工作正常。


There are many things you missed, I would happy to explain you.

  1. Here

    def total_number_of_comments 
     @article = Article.all
     @comments_total = @article.comments.count
    end
    

    You have to do this

    def total_number_of_comments 
        @comments_total = Comment.all.count // simple solution  
    end
    
  2. Next is , you didn't used proper instance variable.

     def total_number_of_articles
        @articles_total = Article.total_number_of_articles
     end
    

    See yourself

    Total number of articles:

    <%= @total_number_of_articles %> // this is wrong
    

    You assigned @articles_total but used @total_number_of_articles. if you use @articles_total it will work fine.

相关问答

更多

相关文章

更多

最新问答

更多
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • 电脑高中毕业学习去哪里培训
  • 电脑系统专业就业状况如何啊?
  • IEnumerable linq表达式(IEnumerable linq expressions)
  • 如何在Spring测试中连接依赖关系(How to wire dependencies in Spring tests)
  • Solr可以在没有Lucene的情况下运行吗?(Can Solr run without Lucene?)
  • 如何保证Task在当前线程上同步运行?(How to guarantee that a Task runs synchronously on the current thread?)
  • 在保持每列的类的同时向数据框添加行(Adding row to data frame while maintaining the class of each column)
  • 的?(The ? marks in emacs/haskell and ghc mode)
  • 一个线程可以调用SuspendThread传递自己的线程ID吗?(Can a thread call SuspendThread passing its own thread ID?)
  • 延迟socket.io响应,并“警告 - websocket连接无效”(Delayed socket.io response, and “warn - websocket connection invalid”)
  • 悬停时的图像转换(Image transition on hover)
  • IIS 7.5仅显示homecontroller(IIS 7.5 only shows homecontroller)
  • 没有JavaScript的复选框“关闭”值(Checkbox 'off' value without JavaScript)
  • java分布式框架有哪些
  • Python:填写表单并点击按钮确认[关闭](Python: fill out a form and confirm with a button click [closed])
  • PHP将文件链接到根文件目录(PHP Linking Files to Root File Directory)
  • 我如何删除ListView中的项目?(How I can remove a item in my ListView?)
  • 您是否必须为TFS(云)中的每个BUG创建一个TASK以跟踪时间?(Do you have to create a TASK for every BUG in TFS (Cloud) to track time?)
  • typoscript TMENU ATagParams小写(typoscript TMENU ATagParams lowercase)
  • 武陟会计培训类的学校哪个好点?
  • 从链接中删除文本修饰(Remove text decoration from links)