Recently, the question of online education has become increasingly acute, during a pandemic, and in connection with the transition to online everything and everyone. The Habr website has materials for installing a basic moodle-based system. In this note, I would like to share some experience of setting up a server for production use (we will talk about setting up software, without clustering and changing the hardware configuration), for the case when the portal is already working with some load. Examples are provided to resolve bottleneck issues that might cause the portal to perform poorly.
1. Apache mod XSEND Files
The description is given on the documentation page , you need it because moodle gives out static files, according to the access rights to them, dynamically. Add-ons like this can boost performance decently. You can read more about X-Sendfile in the article .
This option is enabled in the Apache2 config - specify the directory with moodle data
XSendFile On
XSendFilePath /data/localcache/
XSendFilePath /data/filedir/
2. Using php-fpm
This recommendation is suitable for all more or less significant LAMP projects.
You can increase from the basic parameters: the number of connections, the maximum number of processes running and idle for the server, etc.
For example, for the service config fpm / pool.d / www.conf
pm.max_children = 20
pm.start_servers = 10
3. Changing base php.ini values
max_input_vars ( ). , . , , , .
max_input_vars = 1000000
upload_max_filesize = 512M
max_execution_time = 600
memorylimit = 512M
post_max_size = 512M
max_input_time = 300
moodle Linux , php. opcache . Memcached ( ) .. , .
5.
moodle . - , , (- ). . .
- transport
* smtp:my.pochta.ru
6. Mysql
, MYSQL. MYSQL , . mysqltunner.
- , .
query_cache_size = 16M
innodb_buffer_pool_size = 3500M
tmp_table_size = 68M
max_heap_table_size = 68M
join_buffer_size = 256K
table_open_cache =400
, , ( du). - . https://docs.moodle.org/310/en/System_paths
8.
. .
, - moodle .
!
.