Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage #345

Open
MrYawe opened this issue Apr 24, 2024 · 2 comments
Open

High CPU usage #345

MrYawe opened this issue Apr 24, 2024 · 2 comments

Comments

@MrYawe
Copy link

MrYawe commented Apr 24, 2024

First, thanks for all the amazing work on Bandit :)

In our production we had CPU load increase over time and we fixed it the 22/04 by switching back to Cowboy.
We were using bandit 1.4.2 and thousand_island 1.3.5.

image image

Last weekend (20/04-21/04), I took some screenshots about our live running processes.

We can see that processes with highest reductions count (CPU usage) are all LiveView processes:
image

Bandit.DelegatingHandler.init/1 was often in the top most memory-hungry processes. Maybe there is a link with #339:

image

PS: these two LiveDashboard screenshots were not taken at the same time

@mtrudel
Copy link
Owner

mtrudel commented Apr 24, 2024

I have a hunch that this may be due to older connections not shutting down when the client disconnects (which traces back to the same issues as #344). It's actually next up on my list of things to look at!

@mtrudel
Copy link
Owner

mtrudel commented May 14, 2024

Update: It's not the same issue as #344, but I've got a repro case for this locally (it looks like it may be related to what's left of #339). Not entirely sure what's causing it yet, but I can reproduce a significant reduction / memory difference between Cowboy and Bandit on the exact same workload, so it's just a matter of digging until I can explain / mitigate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants