2    

ILIAS 6 and 5.4 Install-Tutorial for Ubuntu 18.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
2
3
4
5
6
7
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>

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

  • Open htop and count the number of processors or threads (therads are mostly core x 2):
  • Calculation: 2 x 4

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

  • Run again: python ps_mem.py
  • The value "memory for OS, database etc" is the result the script calculated + apache2 consumption
  • 4000 MiB - 2200 MiB + 208 MiB = 1592 MiB 
  • 1592 MiB / 18 MiB

89

MaxConnectionsPerChild

  • Standard value. If its to hight, memory leaks can occure

500

ServerLimit (must be added)

= MaxRequestWorkers

89

  • My settings:
1
2
3
4
5
6
7
8
<IfModule mpm_prefork_module>
StartServers 8
MinSpareServers 4
MaxSpareServers 8
MaxRequestWorkers 89
MaxConnectionsPerChild 500
ServerLimit 89
</IfModule>
  • 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
  • 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


No comment has been posted yet.