REST API performance over HTTP and HTTPS compared

Published on October 28th, 2021

We wanted to find out how would the performance of a REST API be impacted if it is called over HTTP vs. HTTPS.

Here is how we setup this simple performance test:

  • Created and launched a linux based VM in the Cloud
  • Deployed the application containing the REST API code on to the Linux VM
  • Assigned a public IP address to the Linux VM for direct API calls over HTTP
  • Created Load Balancer in the Cloud with TLS/SSL termination and configured it to direct the request to the Linux VM (for API calls over HTTPS)
  • Used JMeter to run the tests to analyze the difference in performance when the REST API is invoked over HTTP vs HTTPS
  • Call the API 120 times over HTTP and 120 times over HTTPS to get the average response time

The performance tests results are recorded in the tables below

Conclusion

Based on the environment setup and results presented above, we concluded that HTTPS did not impact the performance of our REST API negatively, if TLS/SSL termination is handled by the Cloud based Load Balancer.  

Infact, Test # 2 and 4 indicate that HTTPS average response time was better than the average response time over HTTP.


You can contact us at info@apinoncloud.com if you have any questions or comments about the information presented in this post.