mediaaustin
Member
OP
Deliverability Nerd
- Joined:
- Jul 2024
- Posts:
- 276
- From:
- Austin, US
Fail2ban is the Sendmail of intrusion prevention. Everyone runs it because everyone ran it, not because it's optimal.
For what it's worth, on a 512MB HostHatch instance I watched fail2ban eat 80MB resident just parsing logs. That's 15% of RAM to block IPs a simple nftables set could handle.
Lightweight alternatives I've tested:
- Sshguard — C, no dependencies, ~2MB RSS, handles ssh/dovecot/whatever via syslog
- nftables ipset + timer script — 0MB daemon overhead, parses journal yourself
- Crowdsec — heavier but shared blocklists, ymmv on lowend boxes
Sshguard won for my mail servers. Log parsing is solid, ban logic is conservative enough not to trap legitimate SMTP retries from greylisting. The nftables backend integrates cleanly.
Correcting a common misconception: fail2ban's python overhead isn't "negligible on modern systems." on low-end hosting, every MB counts toward OOM kills.
SPF, DKIM, DMARC — holy trinity ✉️
pieter_rtm
Member
- Joined:
- Jul 2024
- Posts:
- 195
- From:
- Rotterdam, NL
To be honest I ran sshguard for six months on a Contabo 256MB plan.
- RSS: 1.8MB
- CPU: negligible, parses syslog via tail
- Reliability: zero crashes, zero false positives on my ssh port
Switched to custom nftables set last quarter. 15-line bash script, systemd timer every 60s. As said, 0MB overhead. The daemon itself was the waste.
Script parses journalctl -u ssh --since "1 minute ago", extracts failed IPs, adds to
set blackhole4 { type ipv4_addr; flags timeout; timeout 1h; }
. Done.
Dry humor: my "intrusion prevention system" now uses less RAM than the MOTD.
Containers before it was cool
steveipw
Member
- Joined:
- Jun 2024
- Posts:
- 163
- From:
- Denver, US
Run ZFS on it, ARC eats 8GB, and you still have room for fail2ban plus a mail server.
But on actual low-end VPS tiers? Agree with Pieter. My KnownHost 1GB box runs a RAIDZ1 pool across three attached volumes, ZFS already starved. Dropped fail2ban, gained stability.
Specs matter. List your RAM budget first, then pick the tool.
zfs send | zfs receive. repeat.