Comments (12)
I'll mark this as help wanted
as I don't currently have the time to investigate. I suspect there is an edge case at play here though as this lib has been used by others in production for a couple of years now with no similar reports.
@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.
from ex_rated.
from ex_rated.
@dsnipe This uses ETS for saving bucket information - could it be you're never purging stale bucket data?
from ex_rated.
@dsnipe did you ever solve this? I wanted to use this in a production application as well, but now I'm scared to.
from ex_rated.
@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.
from ex_rated.
@sergiotapia can you please elaborate further in a separate issue? If if makes every request pass through the exrated bottleneck, then that's serious.
from ex_rated.
https://dockyard.com/blog/2017/05/19/optimizing-elixir-and-phoenix-with-ets
from ex_rated.
@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
from ex_rated.
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.
from ex_rated.
It turned out that ex_rated wasn't a problem. I can close the issue.
from ex_rated.
Thank you everyone and sorry for a false alarm.
from ex_rated.
@jaimeiniesta Yes, every single request that uses exrated.
from ex_rated.
Related Issues (20)
- Support for Elixir 1.1.x HOT 1
- Add a clear_rate/reset_rate function HOT 4
- update to Elixir 1.2 and ex2ms 1.4 HOT 2
- ExRated.check_rate should return the time until the bucket is reset HOT 5
- How to list the existing buckets? HOT 2
- Elixir Version for ex2ms HOT 4
- Open to a Pluggable Storage adapter refactor? HOT 6
- Does the bucket name have to be a string? HOT 7
- Both a daily and requests per second (throttle) scale and limit? HOT 1
- Genserver name is hardcoded to :ex_rated HOT 2
- Avoid GenServer Serialization HOT 8
- New buckets with a request limit of 0 return :ok
- The "Rate Limiting a Phoenix API" link in the README is broken HOT 1
- Can't compile ex_rated on elixir 1.13.0-rc.0-otp-24 HOT 1
- id in delete_bucket's spec should be any HOT 1
- ExRated fails to start HOT 1
- Implementing limits in a day (86400 secs) doesn't seem to start from the first check_rate? HOT 2
- Custom bucket increments
- performance improvement HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ex_rated.