stick 发表于 2011-2-17 20:23:37

本打算用虚拟空间做反向代理的后端的想法失败了

这几天看了lnamp的安装,又鼓捣了一下反向代理的缓存,于是后端独服(其实就跑一个博客)的负载下降到0.5以下,否则平时如果运行一个负载监控脚本,独服每晚都要死机n次,于是就萌生想法要把博客转移到虚拟主机(我认为虚拟空间比限制了cpu和内存的vps突发性能要好)每月还能省出七八百
static/image/smiley/default/lol.gif

看上了hg,几番麻烦验证总算给我通过了包年空间,改下nginx后端ip,重启nginx,于是503 bad gateway不断,停掉nginx用curl测试,连接正常!看来hg的虚拟空间有单ip连接数限制啊!
无奈tk之,希望能把前端的ip加到白名单不做连接数限制,hg回复要我自己解决。。。
目前转移到84的vps再次优化了一下nginx缓存设置,运行良好....
附语法蹩脚的tk原文如下

my hosting is on gator1049.hostgator.com,username xxxxxxxxxxxxxxx.
actually,
I use this shared hosting as a backend , my domain is pointed to another server which is a vps runing a nginx as a frontend .
So there will be a lot of connetions between my frontend server and my shared hosting,
but seems you have a max-conn-limit from the same IP on shared hosting from to prevent your server running on a high load.
When I was testing them I always get a 502 error code,that means connections between nginx and my hosting can't be made.I shutdown nginx,try curl gator1049.hostgator.com to retrieve your default page,then it works OK.
So I think that it might be you max-conn-limit set couse my frontend nginx work hardly.

could you please add my frontend's IP 178.162.x.x to the whitelist,or do some changes,to unlimit the connection from that single IP.

btw,I have this config code on nginx to encure it has cache locally,
proxy_cache_path /home/proxy_cache_dir levels=1:2 keys_zone=cache_one:200m inactive=2d max_size=10g;
proxy_cache_valid 200 304 4h;

There will be a large data transfer only when it runs at the first time.I am sure the data transfer will reduced when the cache is ready.


THX .

--------------------------------------


Hello,

Before we consider such a change, have you tried adjusting the settings on nginx to reduce the number of initial connections while it is building the cache? It seems much more reasonable to adjust these settings so the issue does not occur in the first place and you do not have a negative impact on our other customers who reside on that shared server.

Sincerely,

Jon S.
Linux Systems Administrator
HostGator.com LLC
http://support.hostgator.com


话说回来,nginx和后端的连接数要怎么限制啊,我尝试从前端apachebench测试一下hg连接数上线,100都到不了,搞不来嘛

cnweb 发表于 2011-2-17 21:23:26

呵呵应该不行

yansthisisit 发表于 2011-2-17 21:57:15

看不懂的人路过

thoreausolo 发表于 2011-2-18 17:50:32

这个最好去综合区去问

大飞机 发表于 2011-2-18 19:43:28

原帖由 yansthisisit 于 2011-2-17 21:57 发表
https://www.hostloc.com/images/common/back.gif

看不懂的人路过

张生 发表于 2011-2-19 00:08:54

原帖由 张生 于 2011-2-19 00:08 发表
https://www.hostloc.com/images/common/back.gif

gd的免费空间可以试试看


试过了,可以!大家都说gd空间好是有点道理的

stick 发表于 2011-2-19 00:17:23

做后端的话,不是直接前端返回一个IP给浏览器吗?怎么还需要这么多的前端和后端连接?
其实不是很懂,但我的感觉是这样

qq286735628 发表于 2011-2-19 00:24:21

检查一下这三个东西的timeout时间,这3个东西会影响到连接
proxy_connect_timeout
proxy_read_timeout
proxy_send_timeout
涉及到并发连接数的HTTP Limit Zone模块
不过感觉上这里的连接数限制是前端和浏览器之间的,和后端没啥关系,你试试这里改改

qq286735628 发表于 2011-2-19 00:38:13

原帖由 大飞机 于 2011-2-18 19:43 发表
https://www.hostloc.com/images/common/back.gif


打飞机签名怎么改了?》
页: [1]
查看完整版本: 本打算用虚拟空间做反向代理的后端的想法失败了