Spike Arrest Policy allowing more transactions then configured

anuprai
Participant IV

I have configured spike arrest policy in API proxy deployed in Apigee Hybrid environment.

I have configured to allow only 1ps (1 request per sec) but I can see Spike arrest is not rejecting the calls even though calls are exceeding this number.

Below is the Spike Arrest policy -

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SpikeArrest async="false" continueOnError="false" enabled="true" name="SA-SpikeArrest">
    <DisplayName>SA-SpikeArrest</DisplayName>
    <Properties/>
    <Identifier ref="client_id"/>
    <Rate ref="flow.spikearrest.limit"/>
    <UseEffectiveCount>true</UseEffectiveCount>
</SpikeArrest>

I can see these numbers exceeding in variables in trace -

allowed.count=1
used.count=3
exceed.count=2 

Is there anything I am missing here?

0 2 230
2 REPLIES 2

Not applicable

there are few parameters which impact the count in spike arrest.

1. If the spike arrest is set to 1ps means in 1000ms 1 request.

2. If you have n number of message processors then the above count will become 1000ms n requests.

The 2nd case is the reason in your case. Effective count is not applicable in hybrid. That is only applicable in saas Apigee and onprem > 4.18.05

As per the below documentation each environment is assigned to one and only one message processor.

https://cloud.google.com/apigee/docs/hybrid/v1.1/mp-config

We have 2 pods running and even after triggering more than 10 request spike arrest policy is not throwing the error.

Also the spike arrest variables which are shown in Trace, Is it showing the count of each message Processor or its showing the combined count?

exceed.count=11
used.count=12
allowed.count=1