Git Product home page Git Product logo

Comments (7)

bkraul avatar bkraul commented on May 17, 2024 1

Sure. When I was experiencing high CPU usage, the only env vars I had in my compose were:

      - TZ=America/Chicago
      - F2B_IPTABLES_CHAIN=DOCKER-USER
      - F2B_MAX_RETRY=10

When I added the rest of the vars (and changing the action) the CPU usage went down to normal levels:

      - TZ=America/Chicago
      - F2B_IPTABLES_CHAIN=DOCKER-USER
      - F2B_MAX_RETRY=25
      - F2B_DEST_EMAIL=*******@*****
      - F2B_SENDER=******@******
      - F2B_ACTION=%(action_mw)s
      - SSMTP_PORT=***
      - SSMTP_HOST=*********
      - SSMTP_USER=*********
      - SSMTP_PASSWORD=********
      - SSMTP_TLS=YES

Again, I cannot explain the why, as you can see the log data above shows absolutely no information as to why it would be using high CPU, but this seems to have fixed it.

from docker-fail2ban.

bkraul avatar bkraul commented on May 17, 2024

Seems adding additional environment variables corrected this problem.

from docker-fail2ban.

onedr0p avatar onedr0p commented on May 17, 2024

@bkraul can you be a little more specific just incase other people have this problem?

from docker-fail2ban.

bkraul avatar bkraul commented on May 17, 2024

I know this issue is old. Seems I kept having the same problem even with those config changes. The only thing that worked for me was to use compose version 2.2, and put hard resource limits on the container. It still shows as 100%, but it does not bring the host to its knees....

This is the internal command that is causing the high CPU:

/usr/bin/python /usr/bin/fail2ban-server -f -x -v start 

There are 2 threads with the same command and both are permanently 100% CPU. The stdout log returns no helpful information.

from docker-fail2ban.

crazy-max avatar crazy-max commented on May 17, 2024

@bkraul, I think this is an issue with fail2ban itself. often linked to the backend you use / active jails.
So first if you can try fail2ban outside Docker with all your jails / cfg.

I also updated the Docker image yesterday. Fail2ban now runs with Python 3.7 and you have a new variable to choose the backend (auto / pyinotify / polling).

from docker-fail2ban.

bkraul avatar bkraul commented on May 17, 2024

Downloaded the new image, and will test with it. Thanks man!

from docker-fail2ban.

bkraul avatar bkraul commented on May 17, 2024

Which option in F2B_BACKEND is the default (I know auto, but which one from the 2 is actually used by auto? I am still getting 100% CPU utilization. I've had to institute resource limits on the compose file for this...


  1  [|||                                                                               2.6%]   Tasks: 284, 1116 thr; 2 running
  2  [||||||                                                                            5.8%]   Load average: 1.65 0.92 1.50
  3  [|||||||||||||||||||||||||||||||                                                  35.7%]   Uptime: 00:26:30
  4  [||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]
  Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||2.12G/7.79G]
  Swp[|                                                                           1.51M/976M]

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
29104 root       20   0 21908 17560  6096 R 100.  0.2  2:27.50 /usr/bin/python3 /usr/bin/fail2ban-server -f -x -v start

from docker-fail2ban.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.