Skip to content

Gradual CPU leak: 5% to 345% over 13 days with auditd-logs parser (v1.7.8) #4477

@Zendorea

Description

@Zendorea

Describe the bug
CrowdSec v1.7.8 gradually accumulates CPU usage over days/weeks until it consumes 345%+ CPU. The process starts at ~5% after restart and slowly climbs without bound. After 13 days of uptime, systemd reported the process consumed 3 weeks 2 days 14 hours of CPU time.

The log volume being processed is minimal (~8.5k lines from auditd, ~47 from auth.log), so this is not caused by high throughput.

To Reproduce

  1. Install CrowdSec v1.7.8 on Ubuntu 24.04
  2. Configure acquisition for /var/log/audit/audit.log (auditd) and /var/log/syslog
  3. Let it run for 7-14 days
  4. Observe CPU usage climbing from ~5% to 100%+ over time

Expected behavior
CPU usage should remain stable at ~5-10% regardless of uptime duration.

Evidence

Systemd stop output after 13 days:

May 20 01:49:00 Media-Server systemd[1]: crowdsec.service: Consumed 3w 2d 14h 58min 23.887s CPU time, 573.9M memory peak, 66.0M memory swap peak.

Process state at discovery:

root  3363534  345%  1.0  3110892 159888 ?  Rsl  May13 34007:09 /usr/bin/crowdsec -c /etc/crowdsec/config.yaml

After restart:

root  2781659  5.8%  1.2  2385428 205484 ?  Ssl  01:49  0:32 /usr/bin/crowdsec -c /etc/crowdsec/config.yaml

Acquisition metrics (showing minimal volume):

| Source                         | Lines read | Lines parsed | Lines unparsed |
| file:/var/log/audit/audit.log  | 8.59k      | 8.46k        | 128            |
| file:/var/log/auth.log         | 47         | 17           | 30             |

Acquisition config

filenames:
  - /var/log/audit/*.log
labels:
  type: auditd
source: file
---
filenames:
  - /var/log/messages
  - /var/log/syslog
  - /var/log/kern.log
labels:
  type: syslog
source: file
---
filenames:
  - /var/log/nginx/*.log
labels:
  type: nginx
source: file

Parsers installed

  • crowdsecurity/auditd-logs
  • crowdsecurity/sshd-logs
  • crowdsecurity/nginx-logs
  • crowdsecurity/http-logs

Environment

  • CrowdSec version: v1.7.8-debian-pragmatic-amd64-63227459
  • Go version: 1.26.2
  • OS: Ubuntu 24.04 LTS (kernel 6.8.0-111-generic)
  • Platform: linux/amd64 (Hetzner CPX42)
  • RAM: 16GB
  • Installed via: apt (debian package)

Workaround
Weekly or watchdog-based systemctl restart crowdsec prevents the leak from becoming critical. A watchdog script checking CPU > 50% for 30 minutes and restarting is our current mitigation.

Additional context

  • The leak appears to be in the Go runtime or parser goroutines, not in log processing volume
  • Memory peaks at ~574MB which is high for processing <10k lines
  • The auditd-logs parser chain (child-child-child-crowdsecurity/auditd-logs) may be involved
  • No panics or errors in journalctl logs — it just silently consumes more CPU over time

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions