zooniverse / wildcam-gorongosa-education

This is WildCam Labs, the education/exploration-oriented extension of the WildCam Gorongosa project.
https://lab.wildcamgorongosa.org/
Apache License 2.0
0 stars 1 forks source link

Can't create Assignments with over 4000 Subjects #299

Closed shaunanoordin closed 8 years ago

shaunanoordin commented 8 years ago

Issue: When creating an Assignment that consists of over 4000 subjects, the process fails.

Analysis:

Experimental results:

Subjects | OK? | Size* | Response 
---------+-----+-------+---------
100      | Yes |       |  4.90s
1000     | Yes |       | 20.95s
2000     | Yes |       | 38.08s
3000     | Yes | 129KB | 51.40s
4000     | NO  | 172KB | 60.00s - 504 Gateway Timeout
10000    | NO  |       | 60.00s - 504 Gateway Timeout

*Size of the Request body, if extracted as a .JSON file.

Question: Why does the submission process take so long? In theory an equivalent 129KB "file upload" shouldn't even take 50s to process.

Pinging @marten, @simoneduca and @eatyourgreens for your thoughts.

marten commented 8 years ago

I'd love to take a moment tomorrow to watch the logs while you're doing such a request. See if the bottleneck is the EduAPI or it's subsequent call to Panoptes. Maybe we need to perform some stuff in the background.

shaunanoordin commented 8 years ago

👍 Can do! I've got plenty o' Assignments waiting to be created.

shaunanoordin commented 8 years ago

Thanks to Marten, we have an update on this bug.

Problem: the Panoptes-side processing is a bottleneck.

Solution: The Education API needs to return a response quickly to the user (with new "status" variable saying "still processing..."), while simultaneously processing the rest of the subjects in the background.

Caveat: this means it'll take a short while before Teachers/Students can see all subjects, but this is acceptable for the Assignment use cases.

shaunanoordin commented 8 years ago

We've just received another report from Bridget confirming that teachers are encountering issues with Create Assignment functions. Strangely though, in the screenshots she provided, she encountered the issue's symptions when creating Assignments with only seventeen Subjects, not thousands.

shaunanoordin commented 8 years ago

This was fixed by zooniverse/education-api#33 and zooniverse/education-api#34 , but has a follow up bug in #305 . Welcome to the rabbit hole!