1
votes

I'm trying to test an API Get method when I run the same API for 1000 records in postman the response time is 4 seconds (installed postman in windows 7 and ran the test), whereas in JMeter it is taking 22 seconds, any idea what might be the reason for this?

Steps followed for JMeter run:

  1. GUI mode
  2. Non-GUI mode

Both Postman and JMeter are in same system/network.

Below is the Jmeter result:

Thread Name: Test/TestAPI 1-1
Sample Start: 2018-05-22 17:15:00 IST
Load time: **21406** // this is the issue , same in postman taking only 4712 ms
Connect Time: 425
Latency: 1990
Size in bytes: 3962439
Sent bytes:1130
Headers size in bytes: 175
Body size in bytes: 3962264
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 200
Response message: OK
Response headers:HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
api-supported-versions: 1
Date: Tue, 22 May 2018 11:45:06 GMT
Content-Length: 3958179
Server: Web Server
HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8

Post Man Results:

api-supported-versions →1
content-encoding →gzip
content-type →application/json; charset=utf-8
date →Tue, 22 May 2018 12:00:11 GMT
server →Web Server
transfer-encoding →chunked
vary →Accept-Encoding
1
can you give more details,also what does JMeter results show?user7294900
what kind of information shall i provide ? please let me know. Jmeter results show 200 OK with and average time 22112 ms (22 seconds) , if i run the same API the postman showing as 4720 ms(4 seconds). Jmeter version 4.0Rahul
What happens when you set in JMeter ramp up period (in Thread Group) as 1000 ?user7294900
Still taking almost same seconds , i.e 28 seconds now , Number of threads: 1 , Ramp Up : 1000 , loop count :1 , My system configuration : i3 CPU @ 3.7 GH 8 GB Ram , 64 bitRahul
you are missing header content-encoding in JMeteruser7294900

1 Answers

2
votes

You need to compare similar request. In your case at least 1 header is missing. Add to JMeter's HTTP Header Accept-Encoding gzip,deflate

Follow JMeter's Best Practices to get the best performance, the main one is not to use listeners:

Use non-GUI mode: jmeter -n -t test.jmx -l test.jtl

Use as few Listeners as possible; if using the -l flag as above they can all be deleted or disabled.