Performance tuning
For high-volume public sites Squid is highly recommended in addition to the techniques below.
MidCOM Configuration
Disable scheduling (use staging-live if you really need it) and logging, in the hosts code-init add the following lines:
$GLOBALS['midcom_config_local']['log_level'] = 0;
$GLOBALS['midcom_config_local']['metadata_scheduling'] = false;
$GLOBALS['midcom_config_local']['metadata_approval'] = false;
PHP Caches
Install Turck MMCache (all versions of FS-MidCOM get advantage from this), since there is no PECL package for this you must look for a package for your distro or hand-compile.
Install Memcached and the corresponding PHP extension (ACLs in MidCOM 2.6 can take advantage of this). Install the PHP extension with:
pecl install memcache
After which you must install and configure (and secure) the Memcached itself.
Example configuration in midcom.conf:
$GLOBALS['midcom_config_site']['cache_module_memcache_backend'] = 'memcached';
$GLOBALS['midcom_config_site']['cache_module_memcache_backend_config'] = Array('host' => 'localhost', 'port' => 11211);
MySQL Tuning
Quick and Dirty things
in my.cnf make sure query cache is enabled:
query_cache_type = 1
query_cache_size = 10M
query_cache_limit = 1M
There are other caches to consider as well, see the example my-xxx.cnf -files, usually included in the install. Also tuning the caches to your specific situation may require some work.
Especially if your filesystem is slow for some reason, make sure the atime doesn't get stored for MySQL database files, if you have MySQL datadir as it's own partition (you should), then in /etc/mtab add noatime to the mount options and remount. If not you can use chattr to set the flags on the files via the following command:
chatttr +A -R /path/to/mysql
Which you (probably) must re-run each time new tables or databases are added (maybe you should add it to cron ?)
More about it
Here's a few articles on optimizing mysql, O'Reilly has a good book about it as well.
- 3 Minute MySQL tuning
- Using a MySQL Performance Tuning Analyzer Script, which refers to MySQL Performance Tuning Primer Script.
- Optimizing MySQL: Hardware and the Mysqld Variables (esp the variables part)
- MySQL's Query Cache
- MySQL Presentations: Optimizing MySQL
Tuning Apache
If you seem to collect a lot of apache processes that hog memory try lowering the MaxRequestsPerChild to kill them of faster. Basically this happens because some things take more memory than others and apache children do not like to free memory they have already got for themselves, they just re-use it, so if these memory intensive operations hit always different children then you suddenly have a lot of memory reserved but not really used and the longer the children stay around the longer they reserve that memory.
Google is your friend but here are some pointers

