ebi-gene-expression-group / atlas-web-single-cell

Single Cell Expression Atlas web application
Apache License 2.0
5 stars 5 forks source link

Loading experiments into the cache is failing #385

Closed ke4 closed 2 weeks ago

ke4 commented 5 months ago

We merged some PR to atlas-web-core and atlas-web-single-cell repositories related to Experiment Design refactor.

It looks like that these changes using even more memory as we can't start the web app with them on staging where we have lots of experiment. The web app gets memory issues when it tries to load a huge experiment and it stops there. The original goal of this change was to use less memory in the web app. With just a couple of experiments in the environment, like in our local environment it is working fine.

We have to try to identify the root cause of this issue and create a fix for that and test it in test and staging environment.

Steps:

I already created a new ticket to cover this issue: Adding experiment design as a field to Experiment entity cause a memory issue. I am going to reuse this existing ticket to reinvestigate the work Haider did and identify the part that is good for possible reuse/refactor for the next phase for experiment design refactor: putting experiment design into DB and read the data from there to display it in the web app.

Identify the reusable code in:

ke4 commented 5 months ago

It looks like that the root cause is that we are storing the same huge data in 2 different classes:

We create the ExperimentDesign class with a huge structured data set first. That class is not very well designed. It can be split into more than one classes. After create the ExperimentDesign class we create the Experiment class and copy some huge data structures from the to the Experiment class. So we have them twice now in memory.

ke4 commented 4 weeks ago

The fix has been implemented in this issue: Adding experiment design as a field to Experiment entity cause a memory issue

ke4 commented 4 weeks ago

atlas-web-core: https://github.com/ebi-gene-expression-group/atlas-web-core/pull/123

Controller, service and DAO class for Experiment Design table:

ke4 commented 2 weeks ago

atlas-web-single-cell: https://github.com/ebi-gene-expression-group/atlas-web-single-cell/pull/324

ke4 commented 2 weeks ago

atlas-web-bulk: https://github.com/ebi-gene-expression-group/atlas-web-bulk/pull/151

ke4 commented 2 weeks ago

I collected all the relevant changes from the old PRs to implement the following new features: