Kadiem Alqazzaz
Kadiem Alqazzaz

Reputation: 659

How to test server performance

How can I test server performance to be exact an API?

Let's say this API: https://test.com/new_task. It's a POST request and requires certain data in body. Now how can I test this and know the server maximum capacity (number of requests simultaneously)?

I tried searching in the Postman UI, but I didn't find any option for this purpose. Is there any software or application specifically developed for this purpose?

Upvotes: 1

Views: 2763

Answers (3)

KarelHusa
KarelHusa

Reputation: 2263

An easy solution for API load testing is to use SoapUI (or ReadyAPI if you have a license):

  1. Make a test case according to your needs (either simple or complex)
  2. Create a load test (one-click)
  3. Set a number of parallel threads and when to finish the load test (in time or test runs).
  4. Execute the test and look at statistics.

Load Testing in SoapUI

In SoapUI 5.6 I was able to use hundreds of threads. If you need more (500+, thousands or more) your computer's performance might be the limit. In that case JMeter could be a good option.

More on load testing is in SoapUI documentation.

Upvotes: 0

Neville Kuyt
Neville Kuyt

Reputation: 29619

DmitriT's answer is the one I'd go with.

However, I would add that "maximum capacity" is not entirely black and white, and you probably want to look at the resource utilization on the server, and at the response times you see in your JMeter tests.

Specifically, there's a difference between "the server is slow, but responding", "the server is unacceptably slow, but responding" and "the server is not responding". There's also an uneven distribution of response times.

I'd recommend to agree on an acceptable response time (e.g., 1 second), and use JMeter's "90th percentile" measurement to see at what level of load you breach that response time. That's the point at which your server is practically at its maximum capacity, even if it's still responding.

Upvotes: 1

Dmitri T
Dmitri T

Reputation: 168002

Postman cannot send requests in parallel, maximum you can achieve with it is running your request/collection sequentially for specified number of iterations.

You can consider switching to i.e. SoapUI which has some load testing capabilities (rather limited though)

The best option would be converting your Postman request (or collection) into a load testing tool test plan, for example Apache JMeter is quite powerful.

In order to convert your Postman request (or collection) into a JMeter test plan:

  1. Install JMeter

  2. Launch JMeter's HTTP(S) Test Script Recorder

  3. If your request uses HTTPS protocol - import JMeter's self-signed certificate into Postman

    enter image description here

  4. Configure Postman to use JMeter as the proxy

    enter image description here

  5. Run your request (or collection) in Postman

  6. JMeter will capture the request(s) and create relevant HTTP Request sampler and HTTP Header Manager

  7. Once done you can increase the number of threads (virtual users) in Thread Group and run your request in parallel.

More information: How to Convert Your Postman API Tests to JMeter for Scaling

Upvotes: 2

Related Questions