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

Route Hex.pm requests through old badge server proxies #4994

Closed
calebcartwright opened this issue May 1, 2020 · 3 comments
Closed

Route Hex.pm requests through old badge server proxies #4994

calebcartwright opened this issue May 1, 2020 · 3 comments
Labels
service-badge New or updated service badge

Comments

@calebcartwright
Copy link
Member

Refs #4962 #4957 #4929 (comment)

The Hex.pm API has a rate limit of 100 requests per minute per IP Address, a limit Shields has previously exceeded (#1285 (comment)).

That was previously resolved by Hex whitelisting the Shields OVH production server ip addresses. Now that we've moved our runtime to Heroku the badge servers no longer have static ip's and we're subject to those rate limits again.

We ran into the same thing with the Discord badges and rolled out a workaround (#4956) that routes the requests to the upstream provider via the old badge servers. We can and should do the same for the Hex badges (https://github.com/badges/shields/pull/4956/files#diff-59e43644e767926a5be1ebbe6b3a36d0)

@calebcartwright calebcartwright added the service-badge New or updated service badge label May 1, 2020
@PyvesB
Copy link
Member

PyvesB commented Jul 25, 2020

I've taken a look at our Grafana metrics, and temporarily tweaked the "All request rate" panel to only display the request rate for Hex.pm. Here's what I got for the past 48 hours:
Screenshot 2020-07-25 at 12 51 47

That's a request rate per second averaged over a minute, so you just have to multiply by 60 to compare with the rate limit imposed by Hex.pm if I'm correct. We're almost always below 25 request per minute. Looking at spikes from various other days, I've never seen us go over 50 requests per minute. Bear in mind that we've got five dynos in production, so the requests would be spread across several IP addresses, we're probably around 10 requests per minute per IP during spikes.

As far as I can tell, we're very far from hitting the rate limit. Back in 2017 when the issue with Hex.pm was reported, we didn't have proper cache headers and our homepage would load the Hex.pm badges every single time. That significantly increased traffic to the service, but is no longer a problem nowadays.

I think we should not take any action, and close this issue.

@PyvesB
Copy link
Member

PyvesB commented Sep 11, 2020

I'm going to go ahead and close this one. If anyone notices broken Hex.pm badges, please do ping us.

@PyvesB PyvesB closed this as completed Sep 11, 2020
@chris48s
Copy link
Member

I was under the misguided impression that we were already routing the hex badges via OVH. If we've been running without doing that since we migrated to heroku I am sure someone would have raised an issue if we were hitting the rate limits.
Does that mean we can completely decommission the old servers now? (not that any of us actually have access to, but in principle...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

3 participants