Spike Arrest Policy : Rate limiting per resource

Hi All,

As a part of one requirement , I want to apply spike arrest policy at resource level. We have different spike arrest rates for different resources. I used the Java script policy to set the rate in a variable based on the resource pathsuffix. And referred the variable in the rate of the spike arrest policy. The rate is getting set properly. However, the "ratelimit.OpLevel_SpikeArrest_Throttle.allowed.count" is not getting set properly. It remains same even though I trigger the request for some other resource with different rate settings. Due to this my requests are failing sometime.

Could anyone please help.

Thanks,

Neetu

Solved Solved
0 8 822
1 ACCEPTED SOLUTION

@Neetu Garg ,

You need to use <Identifier> element to uniquely identify and apply spike arrest against individual resources. Are you using same ?

<Identifier ref="proxy.pathsuffix"/>

View solution in original post

8 REPLIES 8

@Neetu Garg ,

You need to use <Identifier> element to uniquely identify and apply spike arrest against individual resources. Are you using same ?

<Identifier ref="proxy.pathsuffix"/>

Thanks Anil !!

It is working now...

@Neetu Garg , Awesome, Glad issue is resolved 🙂

Not applicable

@Anil Sagar,

I want to set 10 TPS for 3 resources individually.

So,if I set 10TPS for Spike arrest,then I guess each resource will not be satisfied with the condition 10TPS for each.Because this 10TPS is shared by resources.

If I set 30TPS for Spike arrest,then even 1 resource can violate the SLA with 30TPS instead of 10TPS.


If I use <identifier> option with proxy.pathsuffix,what should be the message weight I need to give for this scenario?

If you want to set 10ps for each resource then setting the identifier tag with proxy.pathsuffix and rate as 10ps should do. MessageWeight need not be set for this scenario.

Thankyou @GargiTalukdar

Is it fine to have a spike arrest policy with Identifier as a combination of client ip address and resource path. My requirement is to arrest continues requests from an ip address to the resources defined in proxy.

yes, that is fine. you can have the same.