Opencast-Moodle / moodle-block_opencast

Block to manage Opencast publications in moodle
21 stars 27 forks source link

Performance Issue: Series with large amount of Events (100+) #343

Closed thet0ast3r closed 9 months ago

thet0ast3r commented 9 months ago

Greetings! I believe this is the appropriate place to report a performance-related issue we've encountered while using the block_opencast plugin. The problem we've identified involves the plugin's attempt to retrieve all events of a series simultaneously by utilizing the /api/events endpoint with the "is_part_of" filter.

Example Request (Inefficient):

https://tube.tugraz.at/api/events?filter=is_part_of%3Ae6e66e9a-c5ec-4b6e-a781-014fb86ad7d9&sort=start_date%3ADESC&sign=true&withacl=true&withmetadata=true&withpublications=true

This API request takes more than a minute to return a response, leading to a suboptimal user experience and causing timeouts within Moodle, as well as on our network equipment.

Findings: Upon investigation, we discovered that setting the "withmetadata" parameter to false significantly reduces the request duration to under 200ms. Further analysis revealed that the /api/events/[eventid]/metadata endpoint in Opencast takes an excessively long time to respond (over 700ms for a single event), and the time required for retrieving the event list seems to be directly correlated with the number of events in a specific series.

Proposed Solutions: I'm uncertain about the most appropriate solution for this issue, but I believe one of the following approaches may be effective:

If you have any alternative suggestions for addressing the root cause of this performance issue or if additional information is required, please let us know.

Thanks & best regards, Tobias (TU Graz)

NinaHerrmann commented 9 months ago

I think already tackeled in https://github.com/Opencast-Moodle/moodle-block_opencast/pull/342

thet0ast3r commented 9 months ago

Ah, thank you! I missed that pr, should fix it. closing this.