為了對付網站慢速問題,我到這裡查到資料
Quote: http://phorum.study-area.org/viewtopic.php?p=216145#216145
先試試看替 Apache 裝上 mod_deflate 即時壓縮產生的 html ..
稍微減少一些 流量的使用…php 部份則是加上加速器.
mysql 則記得開啟 Query_cache .
PHP 加速器
。mmcache
。eAccelerator – Turck MMCache 的分支專案
後來到 gogle大神查 mod_deflate http://ying.homedns.org/wp/archives/2005/08/13/21/28/00/
vi /etc/httpd/conf/httpd.conf
LoadModule deflate_module modules/mod_deflate.so
<ifmodule mod_deflate.c>
DeflateCompressionLevel 9 # 9 是最高壓縮
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css jsDeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate
</ifmodule>
ref: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
VirtualHost需加入 CustomLog logs/www.xxx-deflate_log deflate才能看到記錄
<VirtualHost *:80>
DocumentRoot /var/www/html/xxx
ServerName www.xxx
ErrorLog logs/www.xxx-error_log
CustomLog logs/www.xxx-access_log common
CustomLog logs/www.xxx-deflate_log deflate
</VirtualHost>
而 MySQL的 Query_cache
http://phorum.study-area.org/viewtopic.php?p=216049&sid=d3a62035ff5715ac0b6b1232532fabb5
http://plog.longwin.com.tw/post/1/63
修改設置
vi /etc/my.cnf
query_cache_size = 2M
查看配置
mysql> show status;
留言