9 июн. 2011 г.

Kloxo: Reducing memory requirements

Reducing memory requirements

Let's reduce the Mysql server memory requirements

# nano /etc/my.cnf

inside section [mysqld] add:
skip-innodb
skip-bdb
skip-locking
port = 3306
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

at the end of the same file add:
[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
# safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout


Let's reduce the Apache server memory requirements

nano /etc/httpd/conf/httpd.conf

We change the KeepAliveTimeout value into:
KeepAliveTimeout 3

We need to modify the IfModule prefork.c section with the following values:
StartServers 1
MinSpareServers 1
MaxSpareServers 5
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 5000

Then we better comment out the unnecessarily loaded modules, such as:
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule ldap_module modules/mod_ldap.so

or whatever you may not need.

Finally, let's verify the Apache configuration:
/usr/sbin/apachectl -t

and apply the new configurations:
/etc/init.d/mysqld restart
/etc/init.d/httpd restart


You can read more here (external link) (cache)

Then, if your needs permit it, you can switch from the Bind DNS server to the Djbdns server, which frees up something like 30 MB.
To do this go to:
Server : Linux/Switch program and then choose djbdns.
Same can be said for Apache switched to Lighttpd.
I don't know about the Bogofilter or Spamassassin switch.


As always, I dont take any responsability for what I wrote



Created by roberto. Last Modification: Thursday 26 May, 2011 11:58:39 by roberto.

Комментариев нет:

Отправить комментарий