Thursday, January 29, 2009

speed up moodle, Apache performance with PHP memory limit, PHP accelerator, TMPFS filesystem

1. PHP performance is better when installed as an Apache module (rather than a CGI) in Fedora/Linux.

2. Check the memory_limit in php.ini,
For Moodle 1.7 or later, the value of memory_limit should be > 40M.

3. Use a PHP accelerator to ease CPU load, such as PHPA, Xcache or eAccelerator.

4. Read/Write performance can be improved by putting the cached PHP pages on a TMPFS filesystem.
Note: The cache contents will vanished when there is a power failure or if the server reboots.

speed up moodle performance with MySQL query cache

MySQL performance
The following are the MySQL settings which can be adjusted for better performance in my.cnf (my.ini in Windows). The file contains a list of settings and their values.

1. Enable the query cache with query_cache_type = 1
2. Set query cache size with query_cache_size = 36M
3. and query_cache_min_res_unit = 2K
4. Set table cache with table_cache = 512 (from moodle 1.7 or higher)


Note: Please make backups of your database before changing any MySQL server configuration.
After the changes to the my.cnf,restart mysql server using the command "service mysqld restart".

faster performance in apache, httpd, enable disk cache

To enable a disk cache, edit the following section in httpd.conf.

##########################

CacheEnable disk /
CacheRoot "/var/www/dir_name"
CacheDefaultExpire 3600

#########################

Where "dir_name" is the directory to be cached.