Showing posts with label Optimization. Show all posts
Showing posts with label Optimization. Show all posts

Wednesday, March 3, 2010

Apache Optimization

Apache Optimization

1. Make a back up of your httpd.conf with following command
cp /user/local/apache/conf/httpd.conf /user/local/apache/conf/httpd.conf-backup



2. vi /user/local/apache/conf/httpd.conf

3. Make the following changes : ( you’d find these near the start )

Timeout 250
KeepAlive On
MaxKeepAliveRequests 250
KeepAliveTimeout 3
MinSpareServers 5
MaxSpareServers 15
StartServers 5
MaxClients 20
MaxRequestsPerChild 2000
HostnameLookups Off

4. Save and exit editor.

Mysql optimization

=========================================
[mysqld]
set-variable = max_connections=500
safe-show-database
local-infile=0
===========================================
[mysqld]
max_connections = 500
key_buffer = 32M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 4000
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 7000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 4M
query_cache_size = 12M
query_cache_type = 1
tmp_table_size = 16M
skip-innodb

[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout