Reputation: 1125
I am using JMeter to do performance testing. I have kepted some 20 virtual users and running some POST rest URL's for 30 mins. I observed that there is some error% increased. (say error% = 30%)
So what I did is: I've added Constant Timer(Thread delay) kepted something like 2 secs, now error% reduced a lot.(say error% = 2%)
1) May I know technically, why error% reduced, after Constant Timer(Thread delay) added?
2) Why do we get errors, when requests keep continuously hitting the server via JMeter? (when Constant Timer or Thread Delay not added)
3) How much time does CPU takes to create each Thread? The reason I asked becoz, I am seeing No of samples/requests in JMeter like 530,000 (when running with 15 virtual users). As per my knowledge, only 4 threads run parallel (if cpu has 4 cores). so then how does my CPU able to create 530,000 requests in 30 mins?
4) In 1 sec, how many threads does CPU can create? (lets say CPU has 4 cores)
Upvotes: 0
Views: 572
Reputation: 268
Please find below answers of your questions..
May I know technically, why error% reduced, after Constant Timer(Thread delay) added?
This is because constant timer is holding the test for every following request for 2 sec and by doing this JMeter is creating a mechanism so that request could not pile up and end up in error that's why you see the reduction in the error percentage.
Why do we get errors, when requests keep continuously hitting the server via JMeter?
Hitting constantly to a request with multiple threads can cause error in output. This is because when jmeter is creating a request and before receiving the response we are creating another thread and the process keeps going on which creates network congestion and returns the error. This is advised always create a realistic performance or load test plan so that actual behavior of system should be analysed.
How much time does CPU takes to create each Thread? The reason I asked becoz, I am seeing No of samples/requests in JMeter like 530,000 (when running with 15 virtual users). As per my knowledge, only 4 threads run parallel (if cpu has 4 cores). so then how does my CPU able to create 530,000 requests in 30 mins?
It totally depends on your system resources and I/O operations. If you have created a plan like 10,000 threads and ramp up time is like 360 seconds.It means you are going to load 27.77 requests per second for a particular request which is a throughput of that particular request. Now imagine if you have 20 requests in your test plan than these 10,000 threads will execute for all 20 requests and total througput will be 27.77 * 20 = 555.44/sec in ideal case and it totally depends on the resources of your server, network, application architecture that is under test.
In 1 sec, how many threads does CPU can create? (lets say CPU has 4 cores)
Thread is just a process which takes memory and you can create as many threads as you like in your test, but under the specified memory and heap size of your system. Like you have 4GB ram on your machine and you are trying to create 10,000 threads than your system will stop responding because out of 4GB there is a portion of memory which is already allocated to other processes and applications installed in your OS. You can always check and try from small to large numbers to create your test plan and how that test plan will be supported by your machine.
Hope you got answers of your questions.
Upvotes: 1
Reputation: 167992
Upvotes: 1