yiisoft / rate-limiter

RateLimiter helps to prevent abuse by limiting the number of requests that could be me made consequentially.

Home Page:https://www.yiiframework.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrent request issues

jiaweipan opened this issue · comments

When concurrent requests are made, flow restriction cannot be applied.
for example,When using caching such as Apcu or Redis, it relies on "TheoreticalNextIncrementTime",It may be dirty reading.

Could be, yes. Have you actually experinced that? Any idea about the fix? I don't see how this operation could be made atomic.

What about using mutex?

Using the atomic features of APCU to support concurrency security, #43 it has implemented this feature.

@rustamwin likely that would hurt possibility handling any significant bandwidth. I'm not sure about it though.

@samdark The non concurrent secure "SimpleCacheStorage" version remains unchanged.It can still be customized and extended.

@jiaweipan worth noting the difference either in readme or in phpdoc.