I'd like to detect heavy load and dynamically enable rate limiter code (crafted out of some great (old) code by J Moberg/Arehart). (Can't use IIS request restrictions - not granular enough)
I'm running lucee 5.3.10.., with IIS
3/4 times a week my servers get hammered for ~40mins by a pretty sketchy crawler of sorts (runs ~10 IPs (regularly changing IP, plus changes his user agent every call & is not cookie-less) out of AWS, hitting me with 50+ requests/s on complex/resource intensive pages.
I see there's some fantastic 'Protection' features in FR to help manage the load, as well as the FRAPI. I will use the WebRequest quantity protection with queue strat, but ideally I would like to throttle the bad IPs, rather than just queue everything so that legit users don't have to wait behind all the garbage requests.
Wondering what the best way to detect load is. Looking at the historic FR metrics from when my servers are facing high req/s - seems like the the earliest sign is a high running request count - say > 75. CPU and Memory are not maxed. I see FRAPI has getRunningRequests() - is that too expensive to call often to check load? Any better options?
thanks!!