We've updated how we use BCFG2's template system so that making changes to your mercury server is easier. All tuneable configs are now located in /etc/mercury/server_tuneables. Changes made to the variables in this file will be applied (and not overwritten) by BCFG2 whenever it updates it's configuration.
When you make changes to the tuneables, remember to have bcfg2 update the environment:
bcfg2 -vqed #update the server environment6/22/10: updated with new default settings.
The following variables can be set in Mercury 1.1:
#/etc/apache2/apache2.conf
APACHE_MAXCLIENTS
#/etc/apparmor.d/usr.sbin.mysqld
APPARMOR_MYSQLD
#/etc/default/tomcat6
TOMCAT_MEMORY
#/etc/default/varnish
VARNISH_MEMORY
#/etc/memcached.conf
MEMCACHED_MEMORY
#/etc/mysql/my.cnf
INNODB_BUFFER_POOL_SIZE
INNODB_LOG_FILE_SIZE
KEY_BUFFER_SIZE
MYSQL_MAX_CONNECTIONS
#/etc/php5/apache2/php.ini
PHP_MEMORY
#/etc/php5/conf.d/apc.ini
APC_MEMORY
#/etc/tomcat6/server.xml
TOMCAT_MAX_THREADS
#/etc/varnish/default.vcl
VARNISH_VCL_ERROR
VARNISH_VCL_FETCH
VARNISH_VCL_HASH
VARNISH_VCL_RECVThe following are the defaults that we provide to the above variables if no value is placed in /etc/mercury/server_tuneables (based on system RAM):
| VARIABLE | 512MB+ | 1024MB+ | 2048MB+ | 4096MB+ | 8192MB+ |
|---|---|---|---|---|---|
| APACHE_MAXCLIENTS | 5 | 10 | 20 | 40 | 80 |
| TOMCAT_MEMORY | 96 | ||||
| VARNISH_MEMORY | 32 | 64 | 128 | 256 | 512 |
| MEMCACHED_MEMORY | 32 | 64 | 128 | 256 | 512 |
| INNODB_BUFFER_POOL_SIZE | 32 | 64 | 128 | 256 | 512 |
| KEY_BUFFER_SIZE | 4 | 8 | 16 | 32 | |
| MYSQL_MAX_CONNECTIONS | 10 | 20 | 40 | 80 | 160 |
| PHP_MEMORY | 96 | ||||
| APC_MEMORY | 96 | 128 | |||
| TOMCAT_MAX_THREADS | 3 | 6 | 10 | 20 | 40 |
The following defaults are not dependent on the amount of system RAM:
| VARIABLE | VALUE |
|---|---|
| APPARMOR_MYSQLD | /mnt/mysql/** rwkl, |
| INNODB_LOG_FILE_SIZE | 1073741824 |
| VARNISH_VCL_ERROR | blank |
| VARNISH_VCL_FETCH | blank |
| VARNISH_VCL_HASH | blank |
| VARNISH_VCL_RECV | blank |
It should be noted that there are other things configured on Mercury servers that are not managed by BCFG2 but are setup on first boot (or by running /etc/mercury/init.sh by hand):
1) root's crontab is setup with the contents of /etc/mercury/default_cron
2) iptables is setup with the config located in /etc/mercury/iptables.template (centos only).
This system allows us to setup cron and iptables with more complicated but sane defaults and still allow you to change them without worrying about BCFG2 setting them back.
To apply your updated settings run
bcfg2 -vqed