Big response time difference between result from JMeter and Postman

Viewed 32

I saw a big difference regarding the API response time with 1 single user/request between JMeter and Postman.

Below is the config on JMeter: enter image description here

The response time was around 8.5s:

enter image description here

However, the response time of the same API request was much faster on Postman:

enter image description here

I ran them from the same laptop and same network. Any idea what caused this big result discrepancy?

1 Answers

My first guess would be Caching.

  • Postman is a browser plugin so you're comparing JMeter which always creates a fresh session including establishing the connection with a browser which might keep the connection open
  • You're not sending the same request at least when it comes to Cache-Control header
  • If you want something to compare JMeter with - it should not be Postman, it should be a tool which establishes clean session each time, i.e. cUrl
  • Even when you amend your JMeter script to behave exactly like Postman, comparing a single request is not something you should be doing, try running 10-100 iterations and compare average/median response times

By the way, in order to stop making assumptions you can just record your Postman request using JMeter's HTTP(S) Test Script Recorder:

  1. Prepare JMeter for recording. Start HTTP(S) Test Script Recorder using the "Recording" template

    enter image description here

  2. Prepare Postman for recording. Configure it to use JMeter as the proxy

    enter image description here

  3. If you're recording HTTPS traffic you will also need to import JMeter's certificate into Postman

    enter image description here

  4. Run your request in Postman. JMeter will capture it and generate relevant HTTP Request sampler and HTTP Header Manager.

Related