问题描述
我使用Jmeter将工作负载注入部署在AWS EC2实例上的应用程序。测试必须非常巨大:持续10个小时,工作负载配置文件具有双峰形状,5分钟内请求约2600个请求。实际上,我有一个m3.xlarge实例,其中部署了应用程序,并且每个运行jmeter实例的m3.xlarge实例有8个。使用python脚本,要注入的工作量将在8个客户端实例之间进行分配,例如,如果原始工作负载为800个请求,每个jmeter实例将注入100个请求。正如我所说的完整测试持续10个小时,并分为每个5分钟的时间步长。每5分钟应用一点工作量变化。实际上,我从每个jmeter实例获取java.lang.OutOfMemoryError:在测试开始后没有任何请求到达应用程序后,立即通过GC overhead overhead exceeded错误。我在网上阅读了很多东西,并且在stackoverflow上,我总结出可能的错误可能是:
$ b $ ul
JMV heap size too low>我解决了在每个jmeter实例的jmeter.bat文件中设置以下内容:
set HEAP = -Xms4g -Xmx4g
set NEW = -XX:NewSize = 4g -XX:MaxNewSize = 4g
无论如何,问题仍然存在。我真的不知道如何解决它。我知道10个小时的测试2600音高要求可能是一个非常重的测试,但我认为应该有一种方法来执行此操作。我使用EC2 m3.xlarge实例,所以我甚至可以将堆大小提高到8G(如果它可能有用),或者将工作负载分散到更多客户端,因为我使用的是实例实例,所以我不会付出太多的代价,但因为我已经将客户端实例的数量从4个增加到8个,以便解决问题并且不起作用,所以我有点困惑,并且我希望在继续获得更多资源之前知道r建议。
提前感谢您。
您的堆设置看起来不正确:
set HEAP = - Xms4g -Xmx4g
set NEW = -XX:NewSize = 4g -XX:MaxNewSize = 4g
您的新等于堆大小,这是错误的。
您可以执行ps -eaf | grep java并显示输出结果吗?
并检查你是否尊重这些建议:
I'm using Jmeter to inject workload to an application deployed on an AWS EC2 instance. The test has to be very huge: it lasts for 10 hours and the workload profile has a bimodal shapes with a pitch of about 2600 requests in 5 minutes. Actually I have one m3.xlarge instance in which the application is deployed and 8 m3.xlarge instances each one running a jmeter instance. With a python script the workload to inject is splitted among the 8 client instances so in example if the original workload as to inject 800 requests, each jmeter instance will inject 100 requests. The full test as I said lasts for 10 hours and is divided into timesteps of 5 min each. Every 5 min a little workload variation is applied. Actually I get from each jmeter instance the java.lang.OutOfMemoryError: GC overhead limit exceeded error immediatly after the test is started and no request arrive to the application. I read a lot online and on stackoverflow, and I concluded the possible mistake could be:
JMV heap size too low-> I solved setting the following in the jmeter.bat files in each jmeter instance:
set HEAP=-Xms4g -Xmx4g
set NEW=-XX:NewSize=4g -XX:MaxNewSize=4g
some mistakes in the code that results in a continue unuseful usage of the garbage collector. So I remove from my test all the jmeter listeners. In particular I was using TableVisualizer, ViewResultsFullVisualizer, StatVisualizer, and GraphVisualizer.
Anyway the problem persists. I really have no idea about how to solve it. I know 10 hours of test with 2600 pitch request could be a very heavy test, but I think there should be a way to perform this. I'm using EC2 m3.xlarge instance so I could even raise the heap size to 8G if it could be useful, or splitting the workload among even more clients since I'm using spot instances so I will not pay so much more, but since I have already doubled the number of client instance from 4 to 8 in order to solve the problem and is doesn't work I'm a little bit confused and I want to know r suggestions before continue to get more and more resources.Thank you a lot in advance.
Your heap settings look wrong:set HEAP=-Xms4g -Xmx4gset NEW=-XX:NewSize=4g -XX:MaxNewSize=4g
Your new is equal to Heap size, this is wrong. Comment NEW part first.
Can you do a ps -eaf|grep java and show the output ?
And also check you respect these recommendations:
- http://jmeter.apache.org/usermanual/best-practices.html
- http://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
Finally, show an overview of your Test plan and , number of threads that you start.
这篇关于Jmeter java.lang.OutOfMemoryError:超出GC开销限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!