简体   繁体   English

使用C#连接到平衡器后面的特定服务器

[英]Connecting to a specific server that is behind the balancer with C#

I have a balancer with 6 servers behind. 我有一个带有6个服务器的平衡器。 When I make a HttpWebRequest any of these servers can resolve. 当我发出HttpWebRequest任何这些服务器都可以解析。 What I need is to test the response time of each server by calling the same URL, but specifying the server to respond (I need to try each of the servers, making the same call). 我需要的是通过调用相同的URL来测试每个服务器的响应时间,但是指定要响应的服务器(我需要尝试每个服务器,进行相同的调用)。

I need to try each of the servers, making the same call 我需要尝试每个服务器,进行相同的呼叫

That totally depends on how the load balancer is configured. 这完全取决于负载均衡器的配置方式。 If you fire six requests, it may very well happen that each of those requests is handled by the same server. 如果您触发六个请求,则很可能这些请求中的每个请求都由同一服务器处理。

Call each of the servers directly, or look at the load balancer's documentation on how to make a request to a specific server behind that balancer, for example using a certain request header. 直接调用每个服务器,或查看负载均衡器的文档,以了解如何向该均衡器后面的特定服务器发出请求,例如使用某个请求标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM