Calculating Capacity

How much and how often does your API usage peak?

Detailed guide related to APIOps Cycles phase:
Minimum Viable API Architecture

How much will the API be used? What should be the rate limit for API consumers? Or should we measure how much data is transferred? How much can our API gateway handle?

The tricky thing is to estimate how much the API will be used.  How much traffic will hit the API during its first weeks? How fast are we anticipating the traffic to scale up or down in the following months? What are the peak times?

Scaling API infrastructure up or down fast is not always easy or cheap, even in a cloud environment.

Discussing with the business helps. Ask how many business transactions are estimated to happen in the next 1-12 months. How many packages are sent to customers or money transfers made?  Use the Capacity canvas to plan for single API or API gateway capacity needs.

How to use the Capacity -template

Draw the scale and estimated amounts vs. calendar time to the template, using business measures such as the number of orders coming in or the number of customers created, updated or search:

New orders in a month

  • Day
  • Minute
  • Second

It is much easier to estimate how many boxes will be shipped than how many API requests are going to be done in one day. The business experts know the answer to the first, and the rest is math. This way we use business measures in this method. This way it’s possible to estimate also bandwidth and storage needs. You just need to understand how big an amount of data is involved in each order. Then multiply at least by x 3 to get the amount of data transferred in the requests.

If there is an existing solution, ask about any visitor statistics about it. This may be useful as a baseline for future usage. Ask about any plans to do big campaigns or product launches. Or any changes to the process, business model, etc. These may cause much more or less traffic than before.

Try to get some tangible measures, for example how many orders are coming in each month? Are there any peak days or times when lots of customers, customer service, or some other group of users would be more active than others? Are the API Consuming services “open for business” every day, all day?

If no one has data about how much traffic there is in a minute or second, try to use the monthly data to calculate the maximum peak in minute and second. These measures are important for setting rate limits to APIs and API consumers so one API consumer is not easily able to overload the whole system. It’s also important for planning capacity for API gateway, firewalls, and other network components and estimating impact on backend systems.

Back to related APIOps Cycles phase:
Minimum Viable API Architecture
APIOps Cycles

method for lean api development

Great APIs need skilled people and a good method, which let's you create APIs as products - fast.
APIOps Cycles method is vendor & technology-neutral.

Read the free e-book "The 8 wastes of lean in API development". Learn quick tips on how to remove the wastes using the APIOps Cycles method.