Setting spike arrest rate by client_id

I have a proxy and want to set the spike arrest policy so that the rate is applied separately for each client_id. The policy is set as:

<DisplayName>_SA.SpikeArrestProxy</DisplayName>

<Properties/>

<Rate>25ps</Rate>

<Identifier ref="request.header.client_id"/>

Monitoring the proxy, I can see traffic from one client is exceeding the 25ps rate, but the policy is not getting applied. Did I miss something with the policy configuration? Is 'MessageWeight' a required parameter for this to work? I am wondering if, without messageweight, Apigee is assigning a default weight of zero and hence the threshold will never be reached for any client.

Any advice would be appreciated.

0 4 227
4 REPLIES 4

Not applicable

There are two things.

First is if you are clear about the mechanism of spike arrest. Let me explain this again, Spike arrest 25ps doesn't mean 25 requests per second. It means 1 request in ech 40millisecond.

The second thing is you have not used the effecive count to true. UseEffectiveCount is a tag which needs to be true to sync the counter across all the MPs, else it will be like, if you have 2mps, then each will have 25ps.

Thank you for the information. I am clear on point one, where 25ps does not necessarily mean exactly that. But the issue I am working on here is that we are seeing a throughput rate of 35ps for this client with no failures.

Point two could definitely be relevant - we have multiple MPs, that could definitely be the issue. I'll read up on effective count and get the policy updated.

Hi Priyadarshi - one question regarding effective count.

If I have say 5 MPs in my environment and specify a rate of 40, omitting the UseEffectiveCount tag will mean each MP will allow the full rate, and the actual throughput rate will be up towards 200ps.

If I set the parm to be true, the effective rate for each MP becomes 8. Does that mean each MP will allow 8 max each per second? Or does it mean the pool of 5 will allow 40 total (ie one MP might do more than 8, but the pool will never allow more than 40 in total in any given second)?

the case one is correct. case two is different. if you have effective count true, and set rate 40ps, then including all mps it will be 40ps but not dividing same to each mp.