This post is part of ‘Speed up Moodle’, a 4 post series showing ways to optimize a Moodle server. By default, Apache loads modules that might not be needed for your Web server. In this third post, I show you how to disable the unnecessary Apache modules to run a bare bones Moodle installation.
Disclaimer: I am not a professional server administrator but I have looked after Moodle servers for several years now, and never experienced major issues. What I am sharing has worked for me, but might not work for you. You’ve been warned!
Why it matters
The more RAM Moodle has access to, the faster it will run and the more users it will be able to serve (if configured properly). It is therefore important for the Web server to use as little RAM as possible, so that more users can be served at the same time. As explained in a previous post, every Apache process uses a specific amount of RAM, and the more Apache modules are loaded, the more RAM each process will use. As Apache processes are run concurrently, the RAM savings are roughly proportional to the amount of processes run simultaneously.
Note: whilst other Moodle users have reported saving significant amounts of RAM disabling unnecessary modules, the gains have been small for me (just over 1MB per process).
Loaded Apache modules
Before you disable Apache modules, you need to get a list of all the Apache modules that are currently loaded on your server. For this, use the following command:
It will return a list similar to this:
The modules labelled as (static) cannot be disabled. The list above represents all of the modules loaded on a default installation of Ubuntu 12.04 LTS.
Disabling unnecessary modules
The command to disable an Apache module is simple. Note that depending on your situation, it may be unwise to disable some modules (e.g. deflate). You can find a description of what each module does on the Apache documentation page.
For example:
Here is the command to disable all unnecessary modules on a default Ubuntu 12.04 LTS server:
If you wish to re-enable the modules, simply type:
Don’t forget to restart your Apache server for the changes to take effect:
Leanest Apache
Here is the list of modules that must be loaded on your Web server to run a default installation of Moodle (doesn’t mean it’ll run fastest). Note that your situation may vary. Read the technical noteshere to check if your system is similar to the one I used for testing.
Testing
It is important to test prior making changes, and after the changes. This is the only way you’ll find whether it has made a difference. You can run your own tests using this great utility programme. You can follow this guide to install it.
In the next article, I will explain how to install APC opcode cache.
Photo credit: Grateful by Woodleywonderworks
Source : http://www.iteachwithmoodle.com/2014/01/22/how-to-optimize-a-moodle-server-part-3-apache-on-a-diet/
0 Response to "How to optimize a Moodle server? Part 3 – Apache on a diet"
Posting Komentar