大佬教程收集整理的这篇文章主要介绍了linux – 根据流量或请求的百分比负载均衡HTTP?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
任何人都可以用HA Proxy,Varnish,Nginx或其他什么来展示这样做的具体例子吗?
# I like starTing my upstream names with _ # so they're not confused with hostnames upstream _old_upstream { server 127.0.0.1:1234; } upstream _new_upstream { server 127.0.0.1:4321; } # Make sure the values here match the names of the upstream blocks above split_clients $remote_addr $split_upstream { 10% _new_upstream; - _old_upstream; } server { LOCATIOn / { # EDIT: I forgot,when using variables in a proxy_pass,you have to # specify the entire request proxy_pass @R_673_10107@://$split_upstream$request_uri; } }
然后,当您想要将更多流量移动到新服务器时,只需更改百分比并运行Nginx -s reload.
以上是大佬教程为你收集整理的linux – 根据流量或请求的百分比负载均衡HTTP?全部内容,希望文章能够帮你解决linux – 根据流量或请求的百分比负载均衡HTTP?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。