Open modem7 opened 1 year ago
@modem7: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
Looks like by removing the syslogs, the CPU usage has gone down.
Will put this in pending whilst I monitor further.
Nope, issue still remains.
Could you dump and maybe send me the file
https://docs.crowdsec.net/docs/next/observability/pprof/#visualize-cpu-usage
Laurence@crowdsec.net
If I try from inside the container:
docker exec -it Crowdsec /bin/bash
Crowsec:/# go tool pprof -http=:8081 http://localhost:6060/debug/pprof/profile
bash: go: command not found
If I try it from the host:
❯ go tool pprof -http=:8081 http://localhost:16934/debug/pprof/profile
Fetching profile over HTTP from http://localhost:16934/debug/pprof/profile
http://localhost:16934/debug/pprof/profile: Get "http://localhost:16934/debug/pprof/profile": read tcp [::1]:55028->[::1]:16934: read: connection reset by peer
failed to fetch any source profiles
I also tried (from host) as it looked like it was trying ipv6 in previous command:
❯ go tool pprof -http=:8081 http://127.0.0.1:16934/debug/pprof/profile
Fetching profile over HTTP from http://127.0.0.1:16934/debug/pprof/profile
http://127.0.0.1:16934/debug/pprof/profile: Get "http://127.0.0.1:16934/debug/pprof/profile": read tcp 127.0.0.1:60706->127.0.0.1:16934: read: connection reset by peer
failed to fetch any source profiles
❯ go tool pprof -http=:8081 http://192.168.50.254:16934/debug/pprof/profile
Fetching profile over HTTP from http://192.168.50.254:16934/debug/pprof/profile
http://192.168.50.254:16934/debug/pprof/profile: Get "http://192.168.50.254:16934/debug/pprof/profile": dial tcp 192.168.50.254:16934: connect: connection refused
failed to fetch any source profiles
After installing go in the Crowdsec container, I was able to get the file.
❯ docker exec -it Crowdsec /bin/bash
Crowsec:/# apk add go
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/13) Installing libgcc (12.2.1_git20220924-r10)
(2/13) Installing libstdc++ (12.2.1_git20220924-r10)
(3/13) Installing zstd-libs (1.5.5-r4)
(4/13) Installing binutils (2.40-r7)
(5/13) Installing libgomp (12.2.1_git20220924-r10)
(6/13) Installing libatomic (12.2.1_git20220924-r10)
(7/13) Installing gmp (6.2.1-r3)
(8/13) Installing isl26 (0.26-r1)
(9/13) Installing mpfr4 (4.2.0_p12-r0)
(10/13) Installing mpc1 (1.3.1-r1)
(11/13) Installing gcc (12.2.1_git20220924-r10)
(12/13) Installing musl-dev (1.2.4-r1)
(13/13) Installing go (1.20.8-r0)
Executing busybox-1.36.1-r2.trigger
OK: 326 MiB in 33 packages
Crowsec:/# go tool pprof -http=:8081 http://localhost:6060/debug/pprof/profile
Fetching profile over HTTP from http://localhost:6060/debug/pprof/profile
Saved profile in /root/pprof/pprof.crowdsec.samples.cpu.001.pb.gz
Serving web UI on http://localhost:8081
http://localhost:8081
Have sent the resulting files via email.
Thanks!
What happened?
Docker crowdsec container is using high CPU usage (50-100%)
What did you expect to happen?
Not have high CPU usage
How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
No response
Crowdsec version
OS version
Enabled collections and parsers
Acquisition config
Config show
Prometheus metrics
Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.