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

Rate limiting Batch.libretexts.org #152

Closed
ymdahi opened this issue Oct 7, 2021 · 5 comments
Closed

Rate limiting Batch.libretexts.org #152

ymdahi opened this issue Oct 7, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ymdahi
Copy link
Collaborator

ymdahi commented Oct 7, 2021

Problem

According to MindTouch, there is a 5000 calls per 5 minute threshold on their API service.
batch.libretexts.org (159.65.100.70) seems to be exceeding this threshold, and is therefore being blocked automatically.

This may/may not be impacting other services, such as transclusions (#153).

Context

Batch hosts nodePrint, a microservice that generates PDFs of books/pages within LibreTexts.

We were notified recently (Sept 28) by MindTouch devs that this server had been blocked for exceeding the limit.

Possible Solution(s)

  • Limit the number of calls
  • Use batch/queuing to better manage calls

Next Steps

  • Document nodePrint as best as we can
  • Find a way to limit calls
@ymdahi ymdahi added the bug Something isn't working label Oct 7, 2021
@ymdahi
Copy link
Collaborator Author

ymdahi commented Oct 7, 2021

@Miniland1333 : any comments would be helpful.

@Miniland1333
Copy link
Member

I am unsure what changed that started causing this issue since I haven't touched that code in a while and they haven't complained about the load being that high.

To do a baseline test, I would recommend turning off the concurrency settings here:

const numThreads = kubernetesServiceHost ? 6 : 4;

Set numThreads and concurrentTexts to 1. Hopefully, this should cause a proportional decrease in Mindtouch's traffic and you should check with them to confirm whether or not this occurs. If this doesn't fix the issue, then we truly have a deep mystery on our hands.

@ymdahi
Copy link
Collaborator Author

ymdahi commented Oct 21, 2021

TODO:

@Miniland1333
Copy link
Member

image
FYI it looks like batching for Chemistry has been broken for some time. I think you need to adjust schedule.js in order to get this working again with the lower rate.

https://chem.libretexts.org/Under_Construction/Development_Details/Admin_Tools/API_Dashboard

@Miniland1333
Copy link
Member

Duplicate of #169

@Miniland1333 Miniland1333 marked this as a duplicate of #169 Sep 3, 2022
@Miniland1333 Miniland1333 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants