Peakin
May 31 2003, 01:56 PM
Hey all,
having just moved away from ensim to cpanel, i'm looking after the server for one site, its huge, between 80 - 90,000 unique hits a day.
Just wondering what all tweaks I can implement on apache to help speed things up, at present I have to have max clients set to 800 (according to most sites thats bad, but if i dont site dies) but what else can I do help apache run that lil' bit more smooth.
I know cpanel restarts apache every 10 mins which isn't great, takes the load upto 60 - 70 at times but that soon drops..
I've done what I can as far as most tweak sites say, I'm just wondering if theres more that can be done...
thanks again for any suggestions in advance.
Phil
Pimpenstein
May 31 2003, 03:05 PM
Need more info on the site. Is this mostly static pages, or is it php /w mysql, or perl etc. Also, tell me the specs of your current server, and the current load averages throughout the day.
greyboy
May 31 2003, 03:50 PM
That kind of action deserves it's own server in my book. No panel, no other virtual hosts, very optimized configurations, etc.
-N
Peakin
May 31 2003, 03:51 PM
Heya,
Its 80% mysql / php driven, some cgi, the rest being html.
its one of those rather nifty dell dual xeon rs servers with 1 gig ram..
when its not on 10 minutely apache restart the server usually levels out about a load of 1 - 2, just each ten mins it hits 60 - 70 which by the time has settled again restarts apache...
frequent problems occur with max connections on mysql and sluggish browsing, hence the maxclients 800.
Pimpenstein
May 31 2003, 04:10 PM
And one moire question, how much ram do you have? I hope you have 2 gb in there, becuase thats a very big site, and ram would help alot. Anyway, heres a few things I'd recomend, if you have not done them already...
1. Keep cpanel updated to the latest "release" version.
2. Under tweak settings, make sure you have mysql version 4 installed and in use.
3. edit /etc/php.ini and look for...
mysql.allow_persistent = On
change to
mysql.allow_persistent = Off
4. Edit /etc/my.cnf to reflect the following (assuming 2 gb ram)..
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=150M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=1m
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
log-bin
server-id=1
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[mysqlhotcopy]
interactive-timeout
5. Restart apache and mysql
Also, you may wish to recompile apache with different memory and handler allowances.
Pimpenstein
May 31 2003, 04:16 PM
NM, i saw you said you only have 1 GB ram.. I'd recomend getting another gig in there, and using my configs above.
Peakin
May 31 2003, 04:52 PM
hi,
thanks for those, i think in future we are going to look at the memory upgrade, it seems now its just eating all we have, but for now can i just modify your settings for 1 gig ? or would the impact be minimal ?
Pimpenstein
May 31 2003, 05:04 PM
for 1 gb, try this in the my.cnf..
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=96
key_buffer=150M
join_buffer=1M
max_allowed_packet=16M
table_cache=512
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=768k
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
log-bin
server-id=1
Peakin
May 31 2003, 05:21 PM
hey,
funny enuff, cpu load just hit 250, requesting the extra ram now.. getting eaten alive
Pimpenstein
May 31 2003, 08:24 PM
Ussually, those kind of cpu loads mean that you are swapping memory to disk.. so yeah, the ram will help.
Peakin
Jun 2 2003, 06:11 PM
Hey,
just dropping a line to say thanks for the tweaks, just got my extra ram fitted tonite, tweakin mysql to 2 gig right now. Excess cpu load has since gone almost completly after turning keep alives off... erradicated all swapping..
average cpu load is now around 2 - 3, but i find that acceptable for site thats having so many hits..
thx again..
Phil
aventure
Jun 3 2003, 09:32 AM
I find sites with keep alive off alot slower...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.