# Aerospike as rate limiter counter

**URL:** <https://discuss.aerospike.com/t/aerospike-as-rate-limiter-counter/6983>\
**Category:** Use Cases\
**Created:** [December 26, 2019, 1:33pm UTC](https://discuss.aerospike.com/t/aerospike-as-rate-limiter-counter/6983 "2019-12-26T13:33:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelim](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@michaelim](https://discuss.aerospike.com/u/michaelim)\
**Post date:** [December 26, 2019, 1:33pm UTC](https://discuss.aerospike.com/t/aerospike-as-rate-limiter-counter/6983/1 "2019-12-26T13:33:55Z")

</div>

Hi All. We’re trying to implement a rate limiting algorithm for accessing our Hybrid RTB platform.

We currently average around 50K QPS and for each of these we fire between 5 and 20 (more in the future) requests to publishers and these are the requests i need to implement throttling on.

Basically what we do is setup counters per publisher, these have a TTL of 1 second and we keep incrementing the counter with each outbound request.

It’s been working fine on low loads but when trying to run this on aerospike in memory on a cluster of 2 16cpu gcp instances it does not hold the load and eventually crashes.

(We are talking around 1 million tps).

I am new to AS and used the out of the box configuration with no performance tweaks.

I guess i’m looking for pointers on how to improve performance and maybe do it in a less resource heavy way as adding more servers gets expensive real fast

I’d appreciate any input.

Thanks!

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [December 27, 2019, 4:13am UTC](https://discuss.aerospike.com/t/aerospike-as-rate-limiter-counter/6983/2 "2019-12-27T04:13:52Z")

</div>

Hey Michaelim! What does your record look like? How big is it? How are you incrementing the counter? Are you using in-memory or on disk? What do you mean by ‘does not hold the load’?
