maxlerebourg / crowdsec-bouncer-traefik-plugin

Traefik plugin for Crowdsec - WAF and IP protection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE] Consider Adding a Parameter for HTTP timeout.

dlgreenwald opened this issue · comments

I'm running on a pretty low powered system in my home lab, and while I'm going to dive into the reasons why and see if I can fix it from that end, I've been getting VERY slow responses from the crowdsec stream. The very wildly, but periods of time like this one are common enough that a few timeouts in a row happen in the plugin, and render the cache entirely invalid, and thus all requests are blocked.

crowdsec log

time="16-08-2023 01:16:34" level=warning msg="client 172.29.28.5 disconnected : write tcp 172.29.28.14:8080->172.29.28.5:56238: write: broken pipe"
time="16-08-2023 01:16:34" level=info msg="172.29.28.5 - [Wed, 16 Aug 2023 01:16:34 UTC] \"GET /v1/decisions/stream?startup=false HTTP/1.1 200 10.308289598s \"Go-http-client/1.1\" \""
time="16-08-2023 01:17:34" level=warning msg="client 172.29.28.5 disconnected : write tcp 172.29.28.14:8080->172.29.28.5:58534: write: broken pipe"
time="16-08-2023 01:17:34" level=info msg="172.29.28.5 - [Wed, 16 Aug 2023 01:17:34 UTC] \"GET /v1/decisions/stream?startup=true HTTP/1.1 200 10.136626381s \"Go-http-client/1.1\" \""

Describe the solution you'd like
I would love to see an ENV variable which can be set, overriding the default 10 second timeout to something less reasonable to mitigate my problem until I can track down the actual cause. I actually switched to the plugin from the bouncer docker image becuase it has the cache hoping that dropping the load on my crowdsec instance would speed up it's responses.

Hi,

The timeout issue is something we faced in the past when it was fixed to 2 seconds.
It is reasonable to add a configurable timeout so any low powered device can use it.
We will add this in the next release.

Best,

Hi @dlgreenwald,

We added the parameter httpTimeoutSeconds in release 1.1.14.
It default at ten and can be setup by using Traefik dynamic configuration.
Support for env variable and env file is reserved for secrets / tls certificates in the plugin.

Best,