然后就是client端法度榜样添加办事引用,因为添加了host映射,所以办事引用地址就是"http://cluster.com"。 代码如下:
- class Program
- {
- static void Main(string[] args)
- {
- for (int i = 0; i < 1000; i++)
- {
- HomeServiceClient client = new HomeServiceClient();
- var info = client.DoWork("hello world!");
- Console.WriteLine(info);
- System.Threading.Thread.Sleep(1000);
- }
- Console.Read();
- }
最后来履行以下法度榜样,看看1000次轮回中,是不是按照权重1:5 的方法对后端的wcf进行调用的???
- #user nobody;
- worker_processes 1;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- # '$status $body_bytes_sent "$http_referer" '
- # '"$http_user_agent" "$http_x_forwarded_for"';
- #access_log logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
推荐阅读
Tech Neo技巧沙龙 | 11月25号,九州云/ZStack与您一路商量云时代收集界线治理实践 跟着人们对信息数据应用的处>>>详细阅读
地址:http://www.17bianji.com/lsqh/38778.html
1/2 1