Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

scottybowl's avatar

Issue with Redis throttling

Hi guys - I was wondering if anyone could help with an issue I'm facing with Redis. I need to throttle requests to various social media networks, either at a per user or per system level. I have the following command:

Redis::throttle($redis_key)->allow($max_requests)->every($max_every)->then(function () use ($service) {

There might be hundreds of $redis_key's, and the problem is that I hit a "maximum database connections reached" error. I'm guessing this throttling command creates some crazy levels of db connections? Is there a way around this?

0 likes
0 replies

Please or to participate in this conversation.