我也被警告了,搬到quantz了,附实用减少流量方法
|
最近IP升得厉害,日IP3500+,同时在线平均150-200,就在高兴的时候,被LP警告了,说再不改善,封了。
网站主要是静态页面,图片不多,电影站,带点色
我刚做了些改善,主要是htaccess设置,如果想缩减流量的朋友不妨看看。
使用的话去掉#注释。
另外希望有人帮忙写几句英文信:http://bbs.idcspy.com/thread-53473-1-1.html
CPU usage:15.80
MEM usage:44.12
MySQL usage:0.2
Top Process %CPU 24.8 /usr/bin/php /home/cn/public_html/cj.php
Top Process %CPU 23.4 /usr/bin/php /home/cn/public_html/cj.php
Top Process %CPU 22.7 /usr/bin/php /home/cn/public_html/cj.php-
- #RewriteEngine on
- #RewriteBase /
- SetEnv TZ Asia/Beijing
- #调整时区,但我调了还是差8小时,应该是mysql也要设置
- RewriteCond %{HTTP_REFERER} !^$ [NC]
- RewriteCond %{HTTP_REFERER} !123.com [NC]
- RewriteCond %{HTTP_REFERER} !soso.com [NC]
- RewriteCond %{HTTP_REFERER} !google.com [NC]
- RewriteCond %{HTTP_REFERER} !baidu.com [NC]
- RewriteRule .*\.(gif|jpg|png|rar|zip|exe|torrent)$ http://123.com/error.bmp [R,NC,L]
- #防盗链
- FileETag none
- #关Etag
- <IfModule mod_expires.c>
- ExpiresActive On
- ExpiresDefault A600
- ExpiresByType image/x-icon A2592000
- ExpiresByType application/x-javascript A2592000
- ExpiresByType text/css A604800
- ExpiresByType image/gif A2592000
- ExpiresByType image/png A2592000
- ExpiresByType image/jpeg A2592000
- ExpiresByType text/plain A86400
- ExpiresByType application/x-shockwave-flash A2592000
- ExpiresByType video/x-flv A2592000
- ExpiresByType application/pdf A2592000
- ExpiresByType text/html A14400
- </IfModule>
- #让文件缓存2592000秒=72小时
- LoadModule headers_module modules/mod_headers.so
- LoadModule deflate_module modules/mod_deflate.so
- DeflateCompressionLevel 3
- AddOutputFilter DEFLATE html xml php js css
- <Location />
- SetOutputFilter DEFLATE
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- BrowserMatch ^Mozilla/4\.0[678] no-gzip
- BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- SetEnvIfNoCase Request_URI \\.(?:gif|jpe?g|png)$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
- SetEnvIfNoCase Request_URI .(?:pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
- Header append Vary User-Agent env=!dont-vary #对代理的设置
- </Location>
- #头两句打开模块,后面的是压缩文件,刚开始可以压缩,但是过几分钟后不知道为什么会500错误:Internal Server Error
- 去掉GZIP压缩这段就没事。
复制代码
[ 本帖最后由 hk2r 于 2009-8-9 03:49 AM 编辑 ] |
|
|
|
|
|
|
qurrel
发表于 2009-8-9 03:31:52
|
显示全部楼层
为啥你的CPU这么高了,还只是警告,我才7.69,就被封了呢?你用的是basic plan吗? |
|
|
|
|
|
|
hk2r
发表于 2009-8-9 03:32:21
|
显示全部楼层
basic plan
也许你的不是CPU超了,或其他原因吧 |
|
|
|
|
|
|
qurrel
发表于 2009-8-9 03:39:51
|
显示全部楼层
但给我的警告是说CPU超了,而且已经超过24小时没理我了;心里好烦 |
|
|
|
|
|
|
hk2r
发表于 2009-8-9 03:48:13
|
显示全部楼层
GZIP那段有问题,希望有人完善下。不能用gzip,一用就500错误
试试防盗链看看

[ 本帖最后由 hk2r 于 2009-8-9 04:01 AM 编辑 ] |
|
|
|
|
|
|
hk2r
发表于 2009-8-9 14:17:49
|
显示全部楼层
|
|
|
|
|
|
一路同行
发表于 2009-8-9 15:22:23
|
显示全部楼层
日IP3500+,同时在线平均150-200 已经是共享主机的上限了,建议你升级到VPS |
|
|
|
|
|
|
hk2r
发表于 2009-8-9 15:36:40
|
显示全部楼层
|
|
|
|
|
|
一路同行
发表于 2009-8-9 15:50:05
|
显示全部楼层
共享主机限制cpu,访问量大了很容易就超资源,开启gzi、防盗链已经没多大效果了,况且现在的LP主机资源限制比以前更紧了 |
|
|
|
|
|
|
hk2r
发表于 2009-8-9 16:12:01
|
显示全部楼层
但我不清楚LP的VPS,升级了就无后顾之忧吗?升级得花多少钱呢? |
|
|
|
|
|