Gradual CPU leak: 5% to 345% over 13 days with auditd-logs parser (v1.7.8)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
Línea de trabajo
Start with the reported acquisition config in /etc/crowdsec/config.yaml and the crowdsecurity/auditd-logs parser chain; compare CPU and memory use over time with the reported low log volume. The report does not name a code file or test, so locate the parser and relevant goroutines before investigating. Done means identifying and fixing the cause so CPU use remains stable during a sustained run.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Install CrowdSec v1.7.8 on Ubuntu 24.04
- Configure acquisition for
/var/log/audit/audit.log(auditd) and/var/log/syslog - Let it run for 7-14 days
- 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
- Lenguaje dominante
- Go
- Estrellas
- 15.1k
- Forks
- 726
- Merge medio
- 2 d 51 min
- PR fusionados (30 d)
- 18
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de crowdsecurity/crowdsec
-
[docker] Align build and debian releasePosiblemente ocupada @albundy83 la tomó hace 2 días. Abiertokind/enhancement needs/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
crowdsecurity/crowdsec#4803 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Bucket queues preallocate all their slots when the bucket is createdPosiblemente ocupada @AdzerKI la tomó hace 4 días. Abiertokind/bug needs/triage os/linux
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
crowdsecurity/crowdsec#4799 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
kind/bug needs/triage os/linux
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
crowdsecurity/crowdsec#4797 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
needs/kind needs/triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
crowdsecurity/crowdsec#4795 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
kind/bug needs/triage os/linux
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
crowdsecurity/crowdsec#4790 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de crowdsecurity/crowdsec
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
nebari-dev/nebi#652 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
govulncheck reports 7 reachable vulnerabilities in dependenciesPosiblemente ocupada @dwisiswant0 la tomó hoy. AbiertoType: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
projectdiscovery/rawhttp#558 ·
-
govulncheck reports vulnerable golang.org/x/net and goldmark in called codePosiblemente ocupada @dwisiswant0 la tomó hoy. AbiertoType: Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
projectdiscovery/cdncheck#549 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
projectdiscovery/pdtm#467 ·