-
Notifications
You must be signed in to change notification settings - Fork 200
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
Request limit for images.weserv.nl: Please share your views #196
Comments
The limit is in the origin, so requests that are cached by CloudFlare will not be counted. |
@andrieslouw, is the request limit per visitor IP or referrer server (the domain where the images are used as |
The limit is per visitor IP, but we'll rewrite the FAQ indeed. We're quite busy, so it may take a couple of days. |
FAQ has been rewritten & published. Let us know if there is anything else we can do to assist. |
Shortly saying the limitation hasn't been changed, making impossible to use images.weserv.nl for things like image gallery. |
The limitation for the service we provide on images.weserv.nl hasn't changed indeed. I'm sorry, it is best effort, and while we may increase the limit in the future, for now this is what we are comfortable with offering on our current servers, keeping the service available to everyone for free. I should've stated that when closing this issue. You're free to use the source code on your own server(s), or on any (free) cloud platform, we'll even offer our support in case you run into trouble doing so. I'm not sure how big the image gallery is you'd be using, but if you're willing to share the amount of images per time that seems reasonable, and fits your use case, please do so. I will run some new calculations on additional/new servers for mid-2020, bearing in mind the futures requested here (animated GIF to MP4 being one of the harder in terms of processing power & capabilities). Recently we've had a big uptake in bandwidth & CPU-demand due to supporting animated GIF resizing, which is nearly saturating our links & CPU-cores, causing some delayed requests on busy hours. I'll reopen this issue to invite people to share their views on the current limits we have, maybe we can agree on a better way to regulate what's available to everyone; we could, for instance, increase the time window in which we measure; so that it would be possible to do 2500 requests in 10 minutes? |
If there is anyone willing to share their wishes for a raised request limit, please do so! I'd like to make some (back of the napkin) calculations to estimate if it would be worthwhile to migrate to a new AMD Zen platform. |
Can we get clarification on this paragraph:
Is origin the website where the image is being displayed on, or the website where the image is being downloaded from? If it's the website where the image is being downloaded from, what happens to popular websites such as imgur, google, etc, do they have an exception? Thanks. |
Origin is the website provided in the |
@andrieslouw Hey! Jumping in on this thread a bit late. 2500 / 10m seems like a great compromise to me. Obviously there will always be exceptions, but 700/3m seems to be chopping things off a bit abruptly for pages with lots of smaller images that are loaded in "bursts". Obviously the dream is no limits, but I understand reality :) Feels a bit strange to be sending feedback on this item to an open-source free service -- at all. Also trying to understand what this means, in a bit more detail (I know it's been asked about before):
I'm just wondering what the definition of an "uncached" request is. At what level of cache? On your server's nginx-cache, I assume? This could also be the CDN cache? Something that needs to go to the origin? Lastly, thanks for this great project. |
I think 2500/10m would be a good compromise. Uncached requests pass through the CloudFlare cache, and also pass through the nginx-cache. The uncached requests will hit the origin server indeed. @kleisauke : Can we change the limit in production? |
To reflect the increased request limit. See: #196.
I just updated the request limit on the production servers to 2500/10m, see: Commit a8efbaa and weserv/docs@b0d1e22 reflects this change in the nginx configuration and documentation. |
@kleisauke @andrieslouw Awesome! Thank you so much! PS. I was unaware of the URL to query rate limit remaining. That's very good to know. Also, I know I said it before, but I really appreciate the fact that you do offer this project and service to the community! It's fantastic and really well designed. |
Just noticed that the rate limit starts refreshing itself slowly as time goes on (e.g. it's not a strict 2500 / 10m limit, seems like a rolling window?) This is a really neat implementation. Makes a lot of sense for throttling requests - I probably would not have thought of that :) |
Thanks for your kind words. Perhaps the URL to check your current rate limit quota should also be mentioned in the FAQ. fwiw, it's highlighted here now:
Indeed, it's a Redis backed rate limiter based on the sophisticated generic cell rate algorithm which provides a rolling time window and doesn't depend on a background drip process. The source code of this nginx module can be found here: |
@kleisauke Agreed, I think the FAQ is a good place. I would not have thought to check the news articles (I did try 'Googling' it.) Reading into that algorithm. Quite elegant. |
Any plans to remove or increase the limitation?
Using images.weserv.nl for image gallery would quickly or even immediately exceed the current request limit.
Also is the limitation in Cloudflare (Cloudflare can cache in its CDN and return its cache without connecting to origin until the CDN cached file removed or expired) or while connecting origin (when Cloudflare tries to receive the resource from origin when isn't found in Cloudflare CDN)?
The text was updated successfully, but these errors were encountered: