Im new to REST API testing, I want to do a load of an HTTP REST API, is there any possibility to do a 100 number of parallel HTTP request testing with Jmeter?
And also my request need a query params, can I provide a list of values to Jmeter and Jmeter can loop each request with one param form the list provided?
Appreciate your help.
JMeter executes requests as fast as it can, I don't fully understand your 100 number of parallel HTTP request stanza.
If you want 100 virtual users concurrently accessing your API endpoint: under Thread Group specify number of threads as 100 and set loop count to Forever or -1. In this case the actual number of requests per second will depend on your application response time
If you want to send 100 requests at exactly the same moment - use Synchronizing Timer
If you need to send 100 requests per second - use Precise Throughput Timer
For parameterizing your request with external data people normally use CSV Data Set Config
Related
I'm a Newbie in using JMeter tool and could not find a approach in JMeter to run End to end performance test of below use case:-
I have https webhook(Hosted on my node JS server) that is invoked on new device creation on Azure IotHub(Webhook subscription is done on Azure IotHub).
Once invoked, I parse the webhook(request) body and generate a unique token.
Once unique token generated, I set that token in the device configuration for which the webhook was called.(I get the deviceId in webhook body)
Once the device configuration set I return the response of webhook as 200.
Now, In JMeter how can I achieve step 1-4. My initial approach is to:-
Write python script to simulate new device creation on IoT hub.
After step 1 I'm not sure how will I capture the webhook invoked and response returned from webhook in JMeter.
Basically, Im not sure how I can successfully capture Step 2 and 4. Step 3 is basically the nodejs code for my webhook hosted on my server.
And I need to run step 2 and 4 200K times to measure the performance.
In summary, I have a script which registers device on cloud which triggers my webhook/api and I will calculate the response time in my script i.e. everything will be written in my script just that I want JMeter to show all the charts etc. based on the calculations I do in my script.And the script should be invoked n number of times as per the load required.
Any help in guiding me the approach would be very appreciated.
I have a solution for this now, in case anyone needs it.
Thread Group --> OS process sampler --> Response time graph
Above are the components I used in my JMeter tool. OS process sampler can run any script on your machine.
I am trying to sync oneDrive Files (metadata and permissions) for a domain using MSGraph API using list, children and permission endpoints.
I am using batching for children and permission endpoints, sending 10-20 request urls in single batch requests concurrently for 10 users.
I am getting a lot of 429 errors by doing so. Though, I was also getting 429 errors on making single (non-batched) calls also.
According to the documentation related to throttling, they ask to
1. Reduce the number of operations per request
2. Reduce the frequency of calls.
So, my question is
Does a batch call of 10 get urls, count as 10 different operations and 10 different calls ?
Does a batch call of 10 get urls, count as 10 different operations and
10 different calls ?
Normally, N URLs will be treated as N+1 operations(even more). N operations from the batch URLs and one for the batch URL itself.
Pay attention to the docs:
JSON batching allows you to optimize your application by combining
multiple requests into a single JSON object.
Due to multiple requests have been combined to one request, the server side just need to send back one response too. But the underlying operation for each URL still need to be handle, so the workload on server side is still very high, just may reduce a little.
The answer lies somewhere in between.
Even though the documentation (cannot find the actual page at this moment) says you can combine up to 20 requests, I found out by experimenting that the limit is currently set to 15. So if you reduce the amount off calls in a single batch you should be good to go.
I'm not sure but it might also help to restrict the batches to a single user.
The throttling limit is set to 10000 items per 10 minutes per user resource, see this blog item
I have a Thread Group with 200 threads. I need to send out 200,000 api requests (with different HTTP request paths) concurrently. Does any of the Jmeter timer can accomplish this? Thank you for your help!
Your use case is not very clear, in order to send 200 000 concurrent requests you need the same amount of threads (virtual users) under Thread Group. Once done you can ensure that they are being executed at exactly the same moment in time by adding Synchronising Timer.
HTTP Request paths can be parameterised using i.e. CSV Data Set Config.
There are also Parallel Controller and Parallel Sampler plugins which you can consider as an alternative, you can install them using JMeter Plugins Manager
I'd like to know what Marketo means by 10 concurrent API calls. If for example 20 people use an API in the same time, is it going to crash ? And if I make the script sleep for X seconds if I get that limit response and try the API call again, will it work ?
Thanks,
Best Regards,
Martin
Maximum of 10 concurrent API calls means, that Marketo will process only 10 simultaneous API requests per subscription at maximum.
So, for example if you have a service that directly queries the API every time it is used, and this very service gets called 11 or more times in the same time, than Marketo will respond with an error message for the eleventh call and the rest. The first 10 calls should be processed fine. According to the docs, the error message the following requests will receive will have an error code of 615.
If your script is single threaded (like standard PHP) and you have more that 10 API calls, and your script is running in one instance, than you are fine, since the calls are performed one after another (so they are not concurrent). However, if your script can run in multiple instance you can hit the limit easily. In case a sleep won't help you, but you can always check the response code in your script and retry the call if it received an error. This retry process is often called Exponential Backoff. Here is a great article on this topic.
I am very new to Jmeter and need to perform a load testing of one SOAP request with 100 Authentication data. I tried the below approach, where I saved the authentication data in CSV file, using CSV Data Config parameterised and passed onto HTTP Authorisation Manager. I am able to sequentially test the SOAP request with all the user authentication data available in CSV, but I need to run concurrently, with all the 100 users. Thanks in advance.
I have 5 users authentication(username/password) in csv file
Set your Number of Threads to 100, and the Loop Count to 1.
Number of Threads has to do with the number of concurrent users that get run.
Loop Count has to do with how many times a user actually does your script.
Note that if your ramp-up is slower than your script time, some users will finish before your test reaches its full concurrency. Check this question for use with the scheduler.
In order to make all the requests to fire at the same time you need to add Synchronizing Timer to your test plan.
Increase "Number of Threads" to 100 on Thread Group level
Add Synchronizing Timer as a child of the SOAP/XML-RPC Request
Set "Number of Simultaneous Users to Group by" to 100
Make sure that CSV Data Set Config has following configuration:
"Recycle on EOF?" - true
"Stop thread on EOF?" - false
Thanks everyone for the quick answer. With the synchronizing timer had to modify "Sharing mode" option to "Current Thread Group" in http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config.