Optimize Apache performance
- by Phliplip
I'm looking for ways to optimize our current web server hosted in-house. I'm trying to supply as much relevant information below. Please let me know if you would require additional information in order to assist.
Server is running 1 single website, which is an online pizza ordering platform built on Zend Framework (ver1). On traffic stats from the last month aprox 6.000 pageloads per day, concentrated mainly around dinnertime. Around 1500 loads/hour peaks in that period.
We recently upgraded from a 2/2mbit aDSL-line to 100/100mbit fiber, and we still have performance issues at dinner time. We assumed the 2mbit was the issue.
Website is pretty snappy in low-load periods.
Hardware
CPU: Intel(R) Xeon(R) CPU 5160 @ 3.00GHz (3000.13-MHz K8-class CPU)
Mem: 328M Active, 4427M Inact, 891M Wired, 244M Cache, 623M Buf, 33M Free
Swap: 16G Total, 468K Used, 16G Free
(6GB physical, 16GB swap)
Filesystem Type Size Used Avail Capacity Mounted on
/dev/ad7s1a ufs 4.8G 768M 3.7G 17% /
devfs devfs 1.0K 1.0K 0B 100% /dev
/dev/ad7s1g ufs 176G 5.2G 157G 3% /home
/dev/ad7s1e ufs 4.8G 2.8M 4.5G 0% /tmp
/dev/ad7s1f ufs 19G 3.5G 14G 19% /usr
/dev/ad7s1d ufs 4.8G 550M 3.9G 12% /var
Server OS
FreeBSD 8.2-RELEASE
Software
apache-2.2.17
php5-5.3.8
mysql-server-5.5
Apache footprint (example, taken from # top)
31140 www 1 45 0 377M 41588K lockf 2 0:00 0.00% httpd
31122 www 1 44 0 375M 35416K lockf 2 0:00 0.00% httpd
31109 www 1 44 0 375M 38188K lockf 2 0:00 0.00% httpd
31113 www 1 44 0 375M 35188K lockf 2 0:00 0.00% httpd
Apache is using the prefork MPM, APC (Alternative PHP Cache). SSL module is loaded, but not utilized (as in don't really work, thus not used). There is a file containing settings for MPM modules, but as i see it's not included in the httpd.conf file, the include line is commented out. Thus i would guess that the prefork MPM is working of default values too.
Here are some other Apache conf values that i found - which are included in https.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
UseCanonicalName Off
HostnameLookups Off