How to make count as configurable in Spike Arrest

Hi

Is there any way we can give reference variable for count in spike arrest policy?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Spike Arrest-2

30ps

My requirement is , this count need to be configurable like from KVM .

I can achieve this in Quota policy , but the issue is I can give unit minimum in minutes . Requirement is 5 trx / sec and if in case 6th trx in sec it should give error . I have given as 300 per minute , but there will be chance 10 trx can come in first second itself , which is exceeding 5 trx /sec .

Is this I can achieve only via Spike arrest (because if i give 300 pm , then it will divide 5 per sec ) ? If yes how I can make count as configurable ?

Or

Is there any way I can achieve this by quota? ie per second transaction.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

PartnerRateLimit

<Allow countRef="partnerRateLimitCount"/>

1

true

true

minute

@Shanish kp

You can set the “Rate” element in Spike Arrest policy using a variable. Refer to Samples section and “Rate” element in Spike Arrest policy documentation for more details.

Here’s the sample on how you can use the variable for the Rate element for your reference:

<SpikeArrest name="SpikeArrest">
  <Rate ref="request.header.rate" />
</SpikeArrest>

The variable value must be in the form of {int}pm or {int}ps.

Also do refer to Comparing Quota, Spike Arrest, and Concurrent Rate Limit Policies documentation. It would help you to understand and choose the right/best policy based on your requirements.

Hi Shanish kp

If there will be a chance of 10 transactions can come in first second itself than it is not possible either using quota or spike arrest. However, you can create your own custom logic using javascript.