-
DescriptionHigh memory and cpu usage with a big alert list. CPU jumps to 80% while memory increases from 100mb to 320mb on every refresh. Running "docker exec crowdsec cscli alerts -l 0 list" comes back with 2 alerts. I am not sure how the widget is pulling alerts and if there is a way to limit how many do we pull. homepage versionv0.8.11 Installation methodDocker Configuration- Crowdsec:
icon: si-springsecurity-#5CDD8B
widget:
type: crowdsec
url: http://crowdsec:8080
username: localhost
password: password Container Logs[2024-04-09T09:03:36.513Z] warn: API response for /api/services/proxy?type=crowdsec&group=Status&service=Crowdsec&endpoint=alerts exceeds 4MB. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit Browser LogsAPI returns 100 alerts on each refresh. Troubleshooting |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Thanks for posting a discussion about homepage here on GitHub. Homepage now uses a fancy new AI tool thanks to our friends at Glime, so the answer below is the AI bot's attempt to answer your question. If you feel it's sufficient you can mark the answer and close this post, otherwise feel free to leave it open of course! Thanks for using Homepage! ❤️ Based on the information provided, it seems that the Crowdsec widget is pulling a large number of alerts, which is causing high CPU and memory usage. The warning in the container logs indicates that the API response size is exceeding 4MB, which is likely due to the large number of alerts being fetched. To address this issue, you can try to limit the number of alerts that the widget pulls. However, the provided documentation does not specify a direct method to limit the number of alerts fetched by the widget. You may need to look into the Crowdsec API or widget configuration options to see if there's a way to set a limit on the number of alerts returned. If the Crowdsec API allows for pagination or setting a limit on the number of alerts, you could modify the API call within the widget configuration to include these parameters. Alternatively, if the widget itself has configuration options for limiting the number of alerts, you should adjust those settings accordingly. Since the specific method to limit the number of alerts is not detailed in the provided documentation, you may need to consult the Crowdsec API documentation or reach out to the Crowdsec community for guidance on how to implement this limitation. If you have access to the Crowdsec API documentation or can contact the developers, it would be beneficial to inquire about the best practices for managing the number of alerts fetched in scenarios with high alert volumes. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
Thats unfortunate. But the Crowdsec API is just pretty limited. I cant think of an obvious solution to this besides Crowdsec adding some more e.g. filters to the API (which would be amazing). If you do decide to contact them, feel free to ping me or let us know... Of course we're open to other solutions. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically closed because it was marked as answered. See our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
Thats unfortunate. But the Crowdsec API is just pretty limited. I cant think of an obvious solution to this besides Crowdsec adding some more e.g. filters to the API (which would be amazing). If you do decide to contact them, feel free to ping me or let us know... Of course we're open to other solutions.