scottmessinger
We just put it into production (Bandit 1.2.2) and are also seeing increased memory usage (about 50% more). We upgraded several libraries, so I don’t want to definitively say it was from Bandit, but it does seem likely.
Side note: I think it’s incredibly impressive for mtrudel to build the whole thing and have it be drop in compatible. Very cool library. That said, we might switch back to cowboy if we can’t resolve the memory issue.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
jjcarstens
We put this in NervesHub and were having issues with websockets in our setup at scale which unlimitedly led to reverting to cowboy (Big lengthy breakdown in that PR as well)
However, just today we found one of the default options in ThousandIsland was to set
It would be worth updating that to see if you still have issues
linger: {true, 30}which would hold sockets and increase memory load. That was fixed today in:thousand_island 1.3.3, we deployed and it was all fixed!Also, we set
thousand_island: [transport_ports: [hibernate_after: 15_000]]in the endpoint which dropped the memory usage significantly as well.hubertlepicki
We rolled it back to Cowboy too. I like the idea but the nature of the project is such that we are getting a lot of requests that are being cancelled before they finish, and Bandid did not interrupt these at all. I suspect this was contributing to the increased load on the servers and increased memory usage, but it’s probably also the architecture that relies on OTP. Cowboy uses their own, simplified primitives for concurrency implementation, precisely because they were able to made them more efficient.
mtrudel
Is this serving primarily HTTP or WS?
If WebSockets, as @jjcarstens sez a few replies down, I’d look at adding
hibernate_after.mtrudel
I haven’t forgotten about you @hubertlepicki! I actually thought of a possible quick win for this; are you able to deploy a branch for testing?
scottmessinger
It’s mainly WS but there was an error when I added hibernate_after. It seemed like it wasn’t an allowed option, likely because I didn’t change the default TCP adapter.
mtrudel
Yep, sorry.
hibernate_afteris specific to:ssl; there’s no equivalent for:gen_tcp.That’s curious that you’re seeing increased memory usage; Bandit’s WS layer is really quite thin (it’s a small bit of mostly bounded state on top of a GenServer). I wonder if it’s lagging process closes, and if Thousand Island 1.3.3 would help?
dimitarvp
I am curious if somebody noticed that increased memory usage in an API project without views / templates / components etc.? And without LiveView / WebSockets?
scottmessinger
I upgraded to Thousand Island 1.3.3 based on this thread, but still saw the high memory usage. I just switched back over to Cowboy and should have better comparison numbers tomorrow morning, but it seems like Cowboy is 1/2 the memory usage of Bandit.
Bandit is great and I’m excited to see these issues all get resolved in time – it’s really impressive work!
tj0
How is everyone measuring memory usage?
dimitarvp
Also
:erlang.memory()– the numbers returned are in bytes.