Optimize your fail2ban memory use by 90%.

Discussion in 'Tips/Tricks/Mods' started by ivomendonca, Oct 26, 2010.

  1. ivomendonca

    ivomendonca Banned

    The solution turns out to be a one-liner on Debian Lenny

    append the ulimit command to /etc/default/fail2ban file.

    Add (to the file) on last line :

    "ulimit -s 256"

    Using this sets the default stack size for the Python instances running fail2ban to 256 KB and lowers the memory consumption of fail2ban approximately by a factor of 10.

    I had 256mb use -> now less than 20.
     
    Last edited: Nov 9, 2010
  2. drewb0y

    drewb0y Member

    my memory usage for fail2ban went from 23980 blocks to 9412 using
    Code:
    ps -aux |grep fail2ban
     
  3. SamTzu

    SamTzu Active Member

    Did not seem to work with me.
    Service did not restart.
     
  4. ivomendonca

    ivomendonca Banned

    Is only a line in a file, there is nothing to fail.
    I think maybe windows is better for you.


    dont include the " ", maybe is that.
     
  5. SamTzu

    SamTzu Active Member

    Quote: Originally Posted by SamTzu [​IMG]
    Did not seem to work with me.
    Service did not restart.


    ..or maybe your instructions were actually false or inaccurate?



    It worked without the quotes. thx.
     
  6. extr3mal

    extr3mal Member

    Greetings to all i had added the line to end of file like it was suggested but i still have problems . When i open htop it shows me 4 instances of fail2ban each one of them eats about 624mb. How to fix that ?
     
  7. nicopingu

    nicopingu New Member

    seems it's an old topic… so go back with defaults
     

Share This Page