I am building a custom LTI that adds gamification to Canvas (
delphinium.uvu.edu). I have been running it in my courses this semester and things have been going fine till now at the end of the semester. I have 100 students and over a hundred assignments for each student, so the submissions API is returning a lot of data.
It takes too long to return so the server is returning a 504 error.
First of all, even if it is a few thousand records, why would it take so long? Is the API just slow? It seems like google can process a few million records in a fraction of second, but the submissions API takes up to 45 seconds or more to return a few hundred records.
Anyway, does anyone have any suggestions on the best way to do prevent the 504 error and/or get the data in quicker?
A few thoughts:
I can't store the content locally in a DB because submission data is very dynamic, for a leaderboard to work, it needs to have current information, same goes for most other game elements like health, progress, etc.
I am considering pagination, but that just adds more time to the request and I'm not sure it would solve the problem
Do you think I am getting throttled for asking for too much data at once? That would be a pain if that were true, I need the LMS to provide my students with relevant data, I would hate to find out that the LMS is stingy with giving the student their data. My understanding though that the error for throttling is 403, not 504.
Thanks in advance for your help!
J