Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading job list is extremely slow #115

Open
nclaidiere opened this issue Apr 15, 2022 · 6 comments
Open

Uploading job list is extremely slow #115

nclaidiere opened this issue Apr 15, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@nclaidiere
Copy link
Collaborator

Uploading job list is extremely slow, about 3 mins for a 5kb csv file (I stopped counting when I had to upload a 10k trial list, I did it overnight but I think it was more than 1h).

@dschreij
Copy link
Member

I haven't experienced this actually! For me this is quite fast, even for larger files.
@smathot what are your experiences with this?

@nclaidiere
Copy link
Collaborator Author

Ok, so one question is does that depend on the number of participants? is the uploading creating jobs lists and session data, etc before assigning participants?

@smathot
Copy link
Collaborator

smathot commented May 13, 2022

I have also never experienced this, but of course I've never worked with a database that's as populated as the one of @nclaidiere.

@smathot
Copy link
Collaborator

smathot commented Jun 23, 2022

I am testing this now on the server of @nclaidiere and I can confirm that this is really slow, about 30 seconds for a table with 50 rows and 2 columns. (Whereas otherwise the server is fairly snappy.) I suspect that Study.processJobs() is the culprit.

@dschreij
Copy link
Member

dschreij commented Sep 18, 2022

Did some research into this, after I also experienced bad performance during an automated test run of a study. During that run, each query took about two seconds (according to the OpenSesame console), while for @smathot executing was in millisecond domain (#92 (comment))
My assumption is that this process is so slow because of queries taking a lot longer than usual, and there are a lot of queries in this function.
I found quite some reports of mysql vastly underperforming when running in Docker (on Windows), for instance:

There are also some proposed solutions for which varying degrees of success are reported:

  • Add :delegated to the mysql data path mapping in docker-compose.
  • Map the docker data folder to a physical location on the disk. It currently points to a volume container, which is the preferred method, but other than that, there wouldn't me much difference for persistence between the two options.

I'll see if I have time to play around with these soon and see if they have any effect. If none of these work, we can also try to:

  • Replace MySQL with PostgreSQL, which is another popular and widely-used open-source database. I mainly work with it for current projects, and it works really well in Docker and on Windows. Since this project uses an ORM that supports Postgres out of the box. It shouldn't be that much work to replace (but may bring some surprises too).
  • Install and run the windows version of mysql locally, making Docker unnecessary. This involves some more steps when setting up and makes the system less portable, but may remedy this and other performance and memory issues.

@smathot
Copy link
Collaborator

smathot commented Sep 19, 2022

My assumption is that this process is so slow because of queries taking a lot longer than usual, and there are a lot of queries in this function.

That does sound likely. That being said, uploading is also slow on servers for which the other queries go very fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants