Hi all,
I have 1x LAPI server with ~15x crowdsec servers. The mariadb server encounter a permanent heavy load due to mariadb process. With 4 vcpu and 12 GB RAM, the load is ~20 and the %cpu is 400%.
Is it normal ? I suppose no of course
I did not find tuning guide of mysql/mariadb from crowdsec (indexing some fields ?, etc âŚ)
Here is what i can see : when i run a mysql command : âshow full processlistâ :
35 crowdsec 127.0.0.1:56116 crowdsec Execute 12953 Storing result in query cache
SELECT DISTINCT decisions.id, decisions.created_at, decisions.updated_at, decisions.until, decisions.scenario, decisions.type, decisions.start_ip, decisions.end_ip, decisions.start_suffix, decisions.end_suffix, decisions.ip_size, decisions.scope, decisions.value, decisions.origin, decisions.simulated, decisions.uuid, decisions.alert_decisions FROM decisions LEFT JOIN decisions AS t1 ON t1.value = decisions.value AND t1.type = decisions.type AND t1.scope = decisions.scope AND t1.until > decisions.until WHERE ((decisions.until > â2024-04-03 09:38:47.758721842â AND t1.until IS NULL) AND NOT decisions.simulated) AND decisions.scope IN (âIpâ, âRangeâ) ORDER BY decisions.id ASC 0.000
This mysql request is a little bit amazing ⌠in itâs complexity of course but also for itâs processing time (12953 seconds !!!) If i understand clearly, this request is played one for every server connected to the LAPI server.
I specify that our decision table contains 1,000,000 entries (ban time is 168h) for 1,400 alerts.
I tried to activate mysql cache, etc ⌠I didnât get any results.
What can i do now ?
Thank you,
Stephane.