Skip to content

Latest commit

 

History

History

spikearrest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Traffic Management using Spike Arrest

| Recipes by Topic | Recipes by Type | Request Enhancement | Report a bug | Fix documentation |

Sample showcasing the throttling of the number of incoming request processed by the API proxy.

Download API Proxy

What is Spike Arrest?

In SAP HANA Cloud Platform, API management we offer the spike arrest which protects the target system against a sudden spike in the traffic. The spike arrest throttles the number of the incoming request processed by the API Proxy. It is recommended to put this policy as the first policy in the API Proxy execution and attached to the PreFlow of the Proxy End Point flow.

This policy can be used with or without the quota policy. . Typically the target server are built assuming a certain load that it can safely handle, While the quota policy allows x number of calls in time period, the spike arrest policy allows to smooth the traffic that to target server.

Quota policy consists of the following elements:-

Element Description Example
Identifier The unique identifier for the quota, this can be used to set quota per developers. Spike Arrest counter per developer apikey <Identifier ref=”verifyapikey.apikeyaccess.client_id”/>
MessageWeight Used to specify the message weight for each calls. The default message weight is 1. The attribute ref can be used to specify a flow variable containing the message weight for the spike arrest. If both explicit weight and ref is specified then ref takes the priority. The possible ways to set it are as follows:- Messageweight of 2 for each message <MessageWeight>2</MessageWeight> Message weight as set in the header <MessageWeight ref=”request.header.weight” />
Rate Rate to which to limit the traffic spikes. It can specified as number of traffic calls per second or per minute Spike Arrest of 2 calls per minute <Rate>2pm</Rate> Spike Arrest of 2 calls per sec <Rate>2ps</Rate>

Click here to view more details on the Spike Arrest policy.

How to use the sample

  • Click on SpikeArrest.zip and then click on the "View Raw" Link or "Download" button to download the sample.
  • Import the Downloaded API Proxy zip into your SAP API management tenancy. Additional instruction for this is available in link.