ILIAS-7-Install-Tutorial for Ubuntu 20.04
Tune up Apache
Maybe you wait with this section until you finally installed ILIAS
Select a MPM
- There are three modes (MPMs, Multi-Processing-Modules) to run apache:
- Prefork
- Worker
- Event
- Let`s start with prefork, because its a very stable and simple mode. But it is also very slow. Later, we will try Event.
Confi Files for Tuning
- There is only one config files that we have to adjust:
nano /etc/apache2/mods-available/mpm_prefork.conf
mpm_prefork.conf
1 | <IfModule mpm_prefork_module> |
Calculate process size
- Repeat this step when the server later will be under load
cd ~
wget https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py
chmod a+x ps_mem.py
python ps_mem.py
Look for the follwoing line:
136.0 MiB + 72.3 MiB = 208.2 MiB apache2 (12)- The (12) means: 12 apache2 processes
- That consumes 208.2 MiB
- And this is for each process appr. 18 MiB: 208.2 MiB/12 = 17,33 MiB
Calculate all other values for mpm_prefork.conf
Attribut | Formular | Calculation | Result |
---|---|---|---|
StartServers | Number of processor cores or threads |
![]()
| 8 |
MinSpareServers | cpu cores/threads x 2 | 2 x 2 | 4 |
MaxSpareServers | cpu cores/threads x 4 | 2 x 4 | 8 |
MaxRequestWorkers | (Total RAM - memory used for OS, database etc.) / process size
|
| 89 |
MaxConnectionsPerChild |
| 500 | |
ServerLimit (must be added) | = MaxRequestWorkers | 89 |
- My settings:
1 | <IfModule mpm_prefork_module> |
service apache2 restart
Proceed a stresstest (if ILIAS is finally installed)
- Open two SSH windows One for ab and one for htop
- 5000 requests and 50 users:
ab -n 5000 -c 50 http://localhost/ilias/login.php
- Gradually increase values for users (-c)
- I am not sure if this is the best way to check the server performance. If you have a hint for me, let me know
- If you get this message: socket: Too many open files (24)
- try (or a higher value than 10000):
ulimit -n 10000
- try (or a higher value than 10000):
- If you get "apr_socket_recv: Connection reset by peer (104)", you reached your limit of users
- Surf on your ILIAS installation. Waiting for loading sites is OK, timeouts are not
Apachebuddy
cd ~
wget https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl
perl apache2buddy.pl