Stevie-Ray / referrer-spam-blocker

Apache, Nginx, IIS, uWSGI, Caddy & Varnish blacklist + Google Analytics segments to prevent referrer spam traffic 🤖
MIT License
373 stars 87 forks source link

How much does these settings affects speed? #130

Open ckissi opened 4 years ago

ckissi commented 4 years ago

I wonder how much does this affects the speed of the Nginx. Anybody measured this?

dvershinin commented 1 year ago

@ckissi there's no exact measuring of performance penalty, but you can imagine based on the following:

In the worst case, there will be a valid visitor with Referer starting with the letter z. Since this blocker is regex-based, that single request may evaluate up to 4 thousand regular expressions sequentially.

I wrote up an article on the better approach that reduces regular expressions to 1.