Layer7 API Management

  • 1.  API Gateway 9.2 - Throttling limit across policies

    Posted Apr 18, 2018 08:19 PM

    Hi,

     

    We are a client who is using 3 services exposed via Gateway. We have to allow the only total of 10 TPS for 3 services.

    The rate should be dynamic such that any combination of rate across 3 policies does not exceed 10. Hard coding TPS limit on each policy ((Policy A = 3TPS, + Policy B = 3TPS + Policy CTPS = 4) EQUALS 10 TPS) is not an option.

     

    Would really appreciate any pointers on achieving this.

     

    Thanks,



  • 2.  Re: API Gateway 9.2 - Throttling limit across policies

    Broadcom Employee
    Posted Apr 24, 2018 12:38 AM

    Dear VA

     

    Based on what you wrote above, I suppose the reason to limit the total number of TPS generate by a group of Services is because they all been routed to the same back-end (and please, feel free to correct me if I misunderstood your requirements). So, the final scope here is to ensure the back-end do not receive more than 10 transaction per second. Our Rate Limit Assertion works per Service (1 to 1).  So, I was thinking if rather than route the request directly to the back-end, those services should route the request to a new Gateway service, that will be used to simply control the TPS (via Rate Limit Assertion) and finally route the requests to the back-end.  I hope that makes sense



  • 3.  Re: API Gateway 9.2 - Throttling limit across policies

    Posted Apr 24, 2018 04:59 PM

    Hi Cristiano,
    Actually, rate limit counters are shared across assertion instances. Using the same custom counter name in multiple services will allow you to apply a rate limit across any number of services. Please see my comment below.

    Cheers,

    Jamie 



  • 4.  Re: API Gateway 9.2 - Throttling limit across policies
    Best Answer

    Posted Apr 24, 2018 04:56 PM

    Hi, 

     

     

    You can achieve this by configuring a Rate Limit Assertion in each service policy to apply a limit of 10 TPS and reference the same custom limit counter. Choose "Custom" from the "Limit each" drop-down, and specify a counter name. Counters (which track the number of requests) are shared across all assertion uses, so requests for each of your three services will be recorded in the same counter.

     

    Please consult the documentation for the assertion for more configuration details: Apply Rate Limit Assertion - CA API Gateway - 9.3 - CA Technologies Documentation 

     

    Cheers,

     

    Jamie Williams



  • 5.  Re: API Gateway 9.2 - Throttling limit across policies

    Posted Apr 24, 2018 09:02 PM

    Thanks Cristiano/Jamie,

     

    I would test the OOB mechanism suggested later and if that does not work then would go for Plan B (introducing a new service in front of backend).



  • 6.  Re: API Gateway 9.2 - Throttling limit across policies

    Broadcom Employee
    Posted Apr 27, 2018 04:16 AM

    In addition to Jamie's answer, just to remind you that the rate limit assertion works locally. If you have multiply gateway nodes, remember the check the "cluster wide" option, and the rate limit is simply divide by the node numbers.

    for example, if you have 2 nodes, limit 10 tps, the exact rate limit is 5 tps per node.

    the document provided by Jamie has more details.