Search⌘ K
AI Features

Discussion on Response Time

Explore methods to calculate API response times for GET and POST requests using parallel and serial subservice processing. Understand factors affecting latency and discover practical optimization strategies such as network enhancements, caching, data compression, and CDN use. This lesson helps you analyze response time to design efficient, user-friendly APIs.

Calculate response time using parallel processing

Let’s use the equation for response time with which we are already acquainted:

In parallel processing, the API gateway communicates with all the subservices simultaneously, as shown in the following illustration:

Parallel processing from API gateway to downstream services
Parallel processing from API gateway to downstream services

We’ll use the processing time to calculate the response time of an API. For that, recall the latency numbers we estimated in the latency lesson to measure the response time of GET and POST requests. Let’s populate the numbers in equation (1):

  • Response time for a GET request=331.42 ms+4 ms=335.42 ms= 331.42\ ms + 4\ ms = 335.42\ ms

  • Response time for a POST request=805.48 ms+4 ms=809.48 ms= 805.48\ ms + 4\ ms = 809.48\ ms ...