openedx / openedx/forum

Performance issues with large volumes of discussion data

Open
#235 10 comments 1 reaction 1 assignee View on GitHub

@taimoor-ahmed-1 is already working on this.

Since Oct 16, 2025.

Dominant language
Python
Stars
5
Forks
26
Avg merge
7d 11h
Merged PRs (30d)
2

Description

Description

Significant performance issues noticed after migrating long-running courses with large volumes of discussion data to MySQL backend.

For a course with around 8000 threads and around 31000 comments, the get threads list API takes around 2 mins to respond and often just times out.

Open edX Release - Sumac
forum release - 0.2.0

Potential Cause

Apart from some DB queries which could be further optimized, the performance issue mostly seems to be arising due to the to_dict methods defined in models in the MySQL backends (Example : Comment to_dict() and ForumUser to_dict()), which in turn recursively fetches data from other models.

I created a POC to optimize the get threads list API and the response time in a sandbox with similar volumes of sample data came down to around 3s. Here, I did the following:

  1. Optimized some queries Ref
  2. Avoided using the to_dic method Ref 1 Ref2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.