-
Notifications
You must be signed in to change notification settings - Fork 51
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
Memory leak problem #19
Comments
Interesting. No I don't have any idea why, and I have not been actively using or maintaining this lib to be honest so if you do find a reason a pull request would be greatly appreciated!
|
@dsnipe This uses ETS for saving bucket information - could it be you're never purging stale bucket data? |
@dsnipe did you ever solve this? I wanted to use this in a production application as well, but now I'm scared to. |
I'll mark this as @dsnipe Can you provide more information as to how you determined that it was this lib that was seemingly at fault for your server memory issue? There is an automatic pruning process for old ETS records which should limit the growth of the ETS tables with old buckets. |
@grempe There's also the issue where adding ex_rated to a Phoenix project essentially turns the application single-threaded since every request goes through the exrated genserver. It becomes a bottleneck. |
@sergiotapia can you please elaborate further in a separate issue? If if makes every request pass through the exrated bottleneck, then that's serious. |
@jaimeiniesta It makes every single request go through the single genserver process. It is really bad. I didn't notice this issue but Chris McCord mentioned it to me and said it was a major problem; turning Phoenix apps into a single-threaded app. He then pointed me to this article: https://dockyard.com/blog/2017/05/19/optimizing-elixir-and-phoenix-with-ets |
But, you mean every single request that uses ExRated, right? Or every single request? It's bad in both cases, but not as bad in the first case. |
It turned out that ex_rated wasn't a problem. I can close the issue. |
Thank you everyone and sorry for a false alarm. |
@jaimeiniesta Yes, every single request that uses exrated. |
Hey!
Thanks for a great library.
We use it in production under high load, but after one month or so we experienced out of memory on the server. We found that the reason is this library.
Our usage example (it's a plug):
And configurations:
config :ex_rated, :timeout, 600_000
In my controller:
plug MyApp.Plug.RateLimit, max_requests: 5, interval_seconds: 60
Maybe you have any ideas what might be a problem? Of course I'll try to investigate it and if I find a solution, will create a PR.
The text was updated successfully, but these errors were encountered: