Moodle v4.0 too slow running in Docker-container

Moodle v4.0 too slow running in Docker-container

par Shota Megrelishvili,
Nombre de réponses : 2

Hello,

Just installed a bare Moodle v4.0 (latest) under a Docker container running on Windows host machine.

Page load speeds are way too low for development. Any clues will be appreciated.

Docker-container runs on Ubuntu 18.04 with Nginx + PHP-FPM 7.4 + MariaDB.
Nginx and PHP.ini have been configured as required by Moodle public docs found on the internet. 
The issue of slow speed was noticed in the installation stage which took about an hour or so. 
Once the installation was successful, the page load time varies from 6 seconds to 40-60 seconds.

Have been able to decrease the page load time by several seconds by disabling `moodle_needs_upgrading` function, but most of the time is eaten by `echo $OUTPUT->....' functions.

Have already tried to fine-tune `opcache` settings from php.ini file, but it doesn't help much.

Before I start digging into profiling of PHP-scripts, could anybody give me a hint if there is anything specific for Docker under Windows I'm missing to achieve acceptable development speed of the project?

p.s. I'm quite proficient with the development of various web-projects under Docker containers and that's not an issue of insufficient ram/cpu of the development machine.

Thank you!

Annexe moodle_issue1.png
Moyenne des évaluations  -
En réponse à Shota Megrelishvili

Re: Moodle v4.0 too slow running in Docker-container

par Marcus Green,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers
If you can reproduce the issue with this
https://github.com/moodlehq/moodle-docker
There will be people who are more familiar with your environment.
Moyenne des évaluations Useful (1)
En réponse à Marcus Green

Re: Moodle v4.0 too slow running in Docker-container

par Shota Megrelishvili,
Thank you for the reply!

The issue here is sharing a folder between host and guest environments of Docker.
To solve the issue, the `moodledata` folder should be created as an independent volume via docker-compose.yml.

Thought it could be useful for someone:
docker-compose.yml example
services:
moodle:
....
volumes:
- moodledata:/var/projects/moodle/moodledata
...

volumes:
...
moodledata:
driver: local