So I installed #fail2ban the other day on my small vps and during a load test I found out that it takes up more than 60% of the CPU during high load. I use(d) it to block annoying attempts to open random php admin pages (I don't even use PHP).
Figured out it's written in python and actually expected such a popular basic tool to be written in C for best performance...
So I started writing a mini clone in #rust and it can handle 300,000 lines/sec on 1 cpu core in first tests.
To be clear I'm not sure actually python is the problem here just it is not really known for performance.
I used fail2ban with ufw as backend. Recently found out when calling ufw from rust that it's super slow and maybe that was actually the problem. Now using iptables and ipset as backend for my mini clone.
Maybe it was just a bad choice to use ufw and not fail2ban's fault but it's still fun to write a mini clone in rust so I'll continue on it.
@musicmatze Sorry, didn't upload it yet as I'm still building as I want to get a halfway usable version first before I publish it.
But I'm almost there so I will upload it soon and let you know 👍
@musicmatze Hey there. Sorry it's been a month and I didn't publish it yet. Currently working on some basic docs so people know how to use it without reading the source code.
Soon. I promise. Will definitely release some initial version in this month. (famous last words 😁 )
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!