I am using JMeter to test downloading of a large file (500 MB) from a server. I want to find out how much parallel downloads the server can support.
I created a test plan with 1000 threads and HTTP Request sampler. I ran the test. But all my requests failed with error like below:
2019-05-06 18:07:33,884 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-11
2019-05-06 18:07:33,884 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.OutOfMemoryError: Java heap space
I googled and found out that increasing the max heap size will fix the issue. So what I concluded is JMeter is downloading the file into RAM. So if there are two parallel downloads of 400 MB going on then 800 MB of RAM will be used. But obviously this is not practical since I have to test for 500 parallel downloads.
I am thinking if I can configure the HTTPRequest sampler to store the downloaded content into disk instead of storing it in RAM or just ignore it (download and discard immediately). This would allow me to test for 500 parallel downloads, which is what I want to achieve.
If anyone knows how to do this please help me with this or let me know if there is an alternate approach.
Try to create a distributed system of Jmeter(master- slave setup) . Note that the JAVA heap space of JMETER on each slave should be more than 6 GB(or more) for example. If you have enough slaves to run, the load sending will be distributed eventually among the slaves and this might solve your issue.
If the issue still persists, Consider movinf the same JMETER distributed configuration to AWS- But this is a huge step.
Just give a try with the first point mentioned.
Additional Note: Please also try by disabling heap dump creation. To remove this Comment DUMP="-XX:+HeapDumpOnOutOfMemoryError" line from JMeter.bat file.
After googling a bit more I realized JMeter does not have any such option but there are other tools which do the same job more efficiently. Here are some of those I tried.
wrk
apache ab
and many more listed here.
Related
I am running JMeter test on machine having 12 GB RAM but I am getting 'OutOfMemory: Heap Space' exception while running the test for 100 users only.
My script has around 300 http requests and is of sync with server scenario.
I have already increased the max heap to 8 GB and tried running the test in Non-GUI mode after disabling all the listeners.
Moreover, I have other script of same application and they are working fine with 200 users load.
Can anyone suggest the changes that I need to do in JMeter for running sync script successfully for 200 users.
As you do not provide much details, it is very hard to answer but check:
that you're not running in GUI mode with View Results Tree as it is an Anti-Practice, if it's the case use NON GUI mode:
https://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
http://jmeter.apache.org/usermanual/best-practices
in jmeter.log that the allocated heap is really what you think
that you have not allocated as much heap as you have RAM, you need to give some memory to the OS (300 MB)
That you're running last jmeter version and not an old one
I'm getting the following error:
out of memory error : java heap space error while running jmeter script for long run say 20 hrs.
I have set 10 GB heap size to run 10 threads only.
Could it be my application's bug? How can I be sure that this is application's bug not a jmeter issue?
JMeter is a Java application with a GUI. It also supports a non-GUI mode which is less resource intensive(CPU/RAM). If we run JMeter in non-GUI mode, it will consume less resource and we can run more threads.
Disable ALL Listeners during the Test Run. They are only for debugging and use them to design the desired script.
Listeners should be disabled during load tests. Enabling them causes additional overheads, which consume valuable resources that are needed by more important elements of your test.
Use Up-to-Date Software:
Java and JMeter should be kept updated.
Decide Which Metrics You Need to Store:
When it comes to storing requests and response headers, assertion results and response data can consume a lot of memory! So it is wise try not to store these values on JMeter unless it’s absolutely necessary.
JMeter SaveService badly configured: Check if you are saving requests and responses in your JTL.
For better and more elaborated understanding, this blog about 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure is helpful.
I am running a test for testing if my application is able to handle 250 concurrent users or not.first time when I ran the test,results were fine and number of samples generated in aggregate report is also fine but when I am running the same test again,i am getting drastic changes in aggregate report.This time number of samples got reduced and also the response time got higher.Whereas cpu usage and memory usage is fine and database server performance is also good.For this I am using stepping thread group.
please help me to get rid out of it.
What about CPU and RAM usage on the host, you're running JMeter on? Make sure that:
You running JMeter in non-GUI mode
You have all the listeners disabled
You have only absolutely minimum of pre/post processors and assertions added/enabled
JMeter has enough JVM heap space (70-80% of your total physical RAM)
See JMeter Performance and Tuning Tips for detailed explanations and more JMeter configuration tricks
Depending on the logic your application has you might not be able to handle 250 threads on single machine (not enough computing resources RAM, NIC bandwidth etc) You haven't provided details about your machine utilization during the run test and Jmeter logs for any warnings or errors. Check that.
We had the same kind of issues when we were testing heavy application (with sessions and long user flows). Master-slave config can fully resolve the issue.
I have created a test plan for creating userprofile.
I want to run my test plan for 100 users but when i run it for 10 users then it is running successfully with rump up time of 2 sec; but when i try it for 100 users & more than that it is getting failed I am giving rump uptime of 40 sec for 100 users.
I am not able to understand what may be the problem with it.
In my test plan the thread user are differentiated with id
Thanks in Advance.
It's a wide question, this behavior can be caused by
Your application under test can't handle load of 100 threads. Check logs for errors and make sure that application/web server and/or database configuration allow 100+ concurrent connections. Also you can check "Latency" metric to see if there is a problem with infrastructure or application itself.
Your load generator machine can't create 100 concurrent threads. If so - you'll need to consider JMeter Distributed Testing
Your script isn't optimized. I.e. using memory-consuming listeners like "View Results Tree", any graph listeners, regular expression extractors. Try following JMeter Performance and Tuning Tips guide and see whether it resolves your issue.
Agree with Dmitri, reason could be one of the above three.
One more thing you can try.
You can run your jmeter in ui mode for validation of your script and after validation you can run it in non-ui mode which will save lot of memory and cpu processing (basically UI is heaviest part in jmeter).
you can run your jmeter script in non-ui mode like this,
Jmeter -n -t -H proxy -P port
generally on a single dual core machine with 2 GB ram (Load Generator in your case) 100 user test can be carried out successfully.
some more things you can look at to find out the actual bottleneck
1.check application server logs (server on which your application is hosted)
if there are any failures in that then see performance counters on server (CPU, Memory, network etc) to see anything is overloaded.
(if server is windows then check using perfmon if linux then try sar)
if something is overloaded then reason is your app server cant take load of 100 users
probably try tuning it more.
2.check load generator system performance counters (JVM heap usage,CPU,Memory etc)
if JVM heap size is small enough try increasing it but if other counters are overloaded then try distributed load testing.
3.remove unwanted/heavy listeners, assertion from script.
maybe this will help :)
I'm using JMeter to test a Java application written by a 3rd party vendor using Versata Logic Studio.
I've got some steps in my test plan that submit a request using some post data and then receive a response back:
Response too large to be displayed. Size: 445817 > Max: 204800, Start of message:
{"header":{"action":"300","arguments":{"tabid":"Header","divid":"ActgDisb,Vendor,BusinessType...ETC
This seems fine (I'm guessing that's 400K?), except that the step is taking far longer than it does to click through the pages in a browser. In the browser it takes 5 seconds at most. In JMeter it's taking 2 minutes. The CPU is also at 60% for just one thread during these steps.
Any ideas on speeding this up? We're struggling to get enough slaves going and this certainly isn't helping.
The message that is displayed tells that you are using View Result Tree during your load test. Jmeter sets a limit that can be changed on the size of pages displayed in this component by adding to user.properties file:
view.results.tree.max_size which defaults to 200 ko
BUT during a load test never ever use this component as it requires a lot of resources (memory and cpu). This component must only be used during scripting phase.
You can read this article that gives tips on JMeter configuration and tuning:
http://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
Disclaimer : I wrote it and it's my company but IMHO I think it's worth reading :-)
Also read this:
http://jmeter.apache.org/usermanual/component_reference.html
If your JMeter script is using a lot of file I/O, then putting those files in RAM will significantly improve the speed. You can use any app such as IMDisk (freeware) to create a virtual disk in RAM. Make sure that you have more than 4GB RAM.
In our case, we are sending around 8000 small files per user. With 200 users on each system, Jmeter is reading 16 Lack files. This was the bottleneck. With the RAM Disk, the file read speed was increased by 20 times and it helped Jmeter to run at full speed.
If you're ready to move to TCP level, there is HTTP Raw Request that allows memory-efficient operation for huge uploads/downloads. Read its manual carefully, there is some JMeter properties for tuning its performance.
However, my experience is that you possibly have a situation where Java itself is a bad technology to perform load tests. I suggest you to take a pair of tries for Raw Request and in case of failure to seek for some C/C++ tool for performance tests.