Hi!
In year 2002 I have created quite popular site built on php+mysql. As for now, it shows more than 2mln pages per day, most of those pages perform some more or less heavy database queries.
Below are listid some useful tricks used to reduce the load.
1) Zend Optimizer
2) Output compression (gz_handler)
3) Using one more ("light") Apache to show pics
4) Spliting data (scripts and pics) onto two hard drives
and, of course, experiments with httpd.conf and my.cnf
The question is: haven't I missed something important? Below is the servers configurations.
httpd:
FreeBSD 4.6
Athlon XP 2100+
1GB DDRAM
2*IDE HDD 40GB 7200RPM
mysql:
Linux Red Hat 8
2*Athlon MP 2000+
2GB DDRAM
IDE HDD 80GB 7200RPM
Services:
httpd (apache 1.3.27, RewriteRule):
Timeout: 300
KeepAlive: Off
MinSpareServers: 8
MaxSpareServers: 16
StartServers: 64
MaxClients: 1024
MaxRequestsPerChild: 5000
httpd (the "light" one apache 1.3.27):
same settings
mysql (mysql 3.23.52, tables type - MyISAM)
set-variable = key_buffer=512M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=256k
set-variable = table_cache=1024
set-variable = sort_buffer=1M
set-variable = record_buffer=1M
set-variable = myisam_sort_buffer_size=128M
set-variable = thread_cache=8
set-variable = max_connection=800
set-variable = max_connect_errors=9999999
set-variable = thread_concurrency=8
server-id = 1
set-variable = interactive_timeout=60
set-variable = wait_timeout=60
Thanks in advance for any ideas about optimization, feel free to ask anything too!