moodle is very slowly

moodle is very slowly

by pingpong gov -
Number of replies: 8

I work in moodle on docker I created docker -compose which downloads volumes so that I can upgrade moodle with personal plugins

Currently moodle works very very slowly. I already tried to increase the memory and it didn't help.

My docker -compose is:

version: '3'
services:
    image: bitnami/mariadb
    container_name: mariadb
    ports:
      - "3306:3306"
    environment:
      - MARIADB_USER=bn_moodle
      - MARIADB_PASSWORD=foobar1111
      - MARIADB_ROOT_PASSWORD=foobar1111
      - MARIADB_DATABASE=bitnami_moodle
    volumes:
      - ./downloads/mariadb:/bitnami/mariadb
    networks:
      default:
        aliases:
          - my-api.dev
  moodle:
    image: bitnami/moodle:latest
    environment:
      - BITNAMI_DEBUG=true
      - MOODLE_DATABASE_HOST=mariadb
      - MOODLE_DATABASE_PORT_NUMBER=3306
      - MOODLE_DATABASE_USER=bn_moodle
      - MOODLE_DATABASE_NAME=bitnami_moodle
      - MOODLE_DATABASE_PASSWORD=foobar1111
      - MOODLE_DATABASE_ROOT_PASSWORD=foobar1111
      - MOODLE_SITE_NAME=Moodle skyvar
      - MOODLE_USERNAME=foobar_user
      - MOODLE_PASSWORD=foobar1111
      - NODE_APP_URL=localhost
    volumes:
      - ./downloads/moodle:/bitnami/moodle
      - ./downloads/moodledata:/bitnami/moodledata
    ports:
      - 80:8080
      - 443:8443
    extra_hosts:
      - "host.docker.internal:host-gateway"  
    depends_on:
      - mariadb
      - api
    networks:
      default:
        aliases:
          - my-api.dev
 
  api:
    build:
      context: .
    ports:
      - 3500:3500
    volumes:
      - .:/var/www
    environment:
      FLASK_DEBUG: "true"
    networks:
      default:
        aliases:
          - my-api.dev
    extra_hosts:
      - "host.docker.internal:host-gateway"
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    ports:
      - '8080:80'
    environment:
      PMA_HOST: mariadb
      PMA_PORT: 3306      
    depends_on:
      - mariadb
    networks:
      default:
        aliases:
          - my-api.dev
volumes:
  mariadb_data:
  moodle_data:
  moodledata_data:

someone can help me?

Average of ratings: -
In reply to pingpong gov

Re: moodle is very slowly

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Could you give some numbers to "slowly", e.g. 3 minutes to load the login page (or whatever you are experiencing). Also what is your hardware setup?
In reply to Marcus Green

תשובה ל: Re: moodle is very slowly

by pingpong gov -
First of all, thanks for the response.
I checked how long it takes for the system to respond, I saw that it takes 8 seconds in a certain case (there are cases where it takes much longer). Of course I want an immediate response to make it user friendly.

Also my hardware settings are:

Device name SVPC-11
Full name of the device SVPC-11.skyvar.co.il
Processor 12th Gen Intel(R) Core(TM) i7-12700F 2.10 GHz
Installed RAM 32.0 GB (31.8 GB usable)
Device ID CE1E0DBB-E1AB-43DB-A673-C9AA2B92AEA9
Product ID 00331-10000-00001-AA727
System type 64-bit operating system, x64-based processor
Pen and Touch There is no pen input or touch input available for this monitor
Windows 11 Pro edition
Version 22H2
Installed on 12/03/2023
Build version of the operating system 22621.2134
Windows Feature Experience Pack 1000.22659.1000.0

I don't understand the hardware.
I would appreciate immediate help.
Thanks.
In reply to pingpong gov

Re: moodle is very slowly

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
There is forum dedicated to this topic, visit the Hardware and performance forum. Your initial pointers are linked to its header. (Don't re-post though - the moderators would move your discussion to the correct forum.)

That said, I fear that little information is available specific to Docker containers is available on moodle.org. For those who are run Moodle natively, the Docker environment is an unknown layer which permanently interfere in debugging.
In reply to Visvanath Ratnaweera

תשובה ל: Re: moodle is very slowly

by pingpong gov -
Thanks for the comment.
Can you give me a link to the forum in question?
Could you explain to me what you meant in the second part you wrote?
In reply to pingpong gov

תשובה ל: Re: moodle is very slowly

by pingpong gov -
I fond the link.
In reply to pingpong gov

Re: תשובה ל: Re: moodle is very slowly

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Yes, welcome to the Hardware and performance forum! (The moderators must have moved the discussion.)
wink

The initial pointers I was talking about are linked to its header, they are called Performance and Performance FAQ to be specific.

In the second paragraph I meant, so far there are fewer Docker helpers here than say Linux native (directly on Debian, Ubuntu, RedHat, CentOS,..) installers. Run an Advanced forum search to find previous discussions on topics similar to yours. 
In reply to pingpong gov

Re: moodle is very slowly

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Their are a LOT of things that contribute to a setup like yours, being very slow, because of all the layers of processes that are running when you have Moodle running in an interpreted language, PHP, with a Database program, with an Apache web browser program, in a docker that I have no idea what it uses, in Bitnami, in Windows which tries to run the "kitchen sink", etc.

You can actually see this at work by typing, Ctrl+Alt+Delete, and then click on, Task manager.  Make sure you are on the Processes tab and look at everything that is running and consuming resources, and by the way, in many cases unnecessarily slowing down the Apps processes you are probably interested in. Before you start your docker, to really see what is "using" all the power, Click the label at the top of the column, for CPU. This will constantly shuffle the list by moving the app to the top that is using the most CPU.

Click the Startup tab. If you are like me, you probably have some programs starting up that you do not need all the time. For instance I have a smart phone emulator program for working on Moodle Mobile apps. The one I use always wants to install itself so that it automatically starts up every time the computer is turned on. However, if I am not working on mobile code for any of my plugins, I DO NOT need for this program to waste time and resources by starting up, so I have it set to, Disabled, in the Status column. Note that you  can right click on any Apps, Status, and change it. Be careful here as there are some things that probably should be disabled, but some things you need to leave alone.

This is where spending just a little money can improve you frustration level due to slowness. I do run stuff on my Windows 10 computer, similar to what you are doing and it is VERY slow. I have a number of small board computers, Raspberry Pi's, 2, 3, and 4, as well as some Orange Pi5's, where I run all Moodle's from v1.19.19 to what will soon be Moodle 4.3. You actually only need one, but I have a bunch due to all the experimenting I like to do. The physical clock speed of these SBC's is very close to what you have listed for your computer and about one-third slower than my desktop. However the perceived speed of a Moodle on one of these SBC's is MUCH MUCH faster, than any setup I have running on Windows ten. Most of the speed up is due to the elimination of the windows virtual host/Bitnami/Docker code layers
Average of ratings: Useful (3)
In reply to pingpong gov

Re: moodle is very slowly

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
If you would explain where you want to go, the community here might show you a straight path.

 If you want to develop something around Moodle, you've just missed the Moodle Academy webinar "Setting up a Moodle development environment". I hope, they'll upload the recording soon.

Here are the links to two things presented there: