Fail2Ban auf OpenVZ -> Speicherprobleme
by admin on Mai.23, 2010, under Technik
Nach den ständigen DNS Query Versuchen (siehe einer der letzten Posts) war nach der Installation von fail2ban erstmal Ruhe. Die DNS Server laufen aber (weil eh nicht viel zu tun) virtuell als OpenVZ vServer, und hier gibts mit fail2ban auch gleich das erste Problem:
Unfortunately the first start of the new service turned out to blow up the memory usage by about 100 MB which is unacceptable regarding the tight resources of my virtual private server. As I found out, others had similar experience and switched to DenyHosts due to this issue. My experience with setting up Trac two weeks ago taught me that a Python application (like fain2ban) might consume a lot of memory only because of the relatively oversized default stack size on Linux.
The means to reduce the default stack size in Linux are widely known to be the limits.conf file and the ulimit command. But how to use those two in my situation? The solution turns out to be a one-liner on Debian Lenny: All I had to do was to append the ulimit command to my /etc/default/fail2ban file.
Hier gefunden: CLICK ME
Die Lösung ist recht einfach: in der /etc/default/fail2ban folgenden Eintrag machen, und den Dienst neu starten:
ulimit -s 256
Der Speicherverbrauch ist wirklich um den Faktor 10 zurückgegangen