简体   繁体   English

多个SignalR集线器类型在一个背板上 - 优点/缺点/可扩展性?

[英]Multiple SignalR hub types over one backplane — pros/cons/scalability?

Recently we've tried to change the SignalR on a couple web apps to work in a web farm situation by using a SQL backplane. 最近,我们尝试使用SQL背板将一些Web应用上的SignalR更改为在Web场中工作。

The number of different ways we could tweak it are multiplying in my head as I explore how it's working (toward the goal of most scalability, least points of failure). 当我探索它是如何工作的时候,我们可以调整它的不同方式的数量正在增加(朝向大多数可扩展性的目标,最少的失败点)。

Currently SignalR is used by each app to support a poll-driven broadcast of changes noted in the database. 目前,每个应用程序使用SignalR来支持数据库中记录的轮询驱动的更改广播。

Essential assumptions/observations about using one backplane for all SignalR instances on all apps: 关于在所有应用上为所有SignalR实例使用一个背板的基本假设/观察:

  1. All hubs and hub instances (of all types) that have one common backplane live on just one messagebus. 所有具有一个公共背板的集线器和集线器实例(所有类型)仅位于一个消息总线上。

  2. All hub instances essentially "merge" their client pool. 所有中心实例基本上都“合并”其客户端池。 The hub instance cannot actually know how many clients they have. 中心实例实际上无法知道他们拥有多少客户端。

  3. Message traffic from some AppB_Hub can be seen in trace output from AppA. 来自某些AppB_Hub的消息流量可以在AppA的跟踪输出中看到。 I assume if AppA had a hub with the same name they'd be in conflict -- or maybe not as long as they realized they'd be sharing clients. 我假设如果AppA有一个名称相同的中心,他们会发生冲突 - 或者只要他们意识到他们将共享客户端。

Questions/concerns/unknowns: 问题/顾虑/未知数:

  1. Do different hubs (different hub type, possibly different assembly) play nicely? 不同的集线器(不同的集线器类型,可能是不同的组件)可以很好地运行吗? ie would messages & calls on one ever interfere with the other? 即一个上的消息和呼叫是否会干扰另一个? In what situations? 在什么情况下?
  2. Is it all based on naming? 这一切都基于命名吗? ie if AppAHub and AppBHub want to play nicely do they need to make sure their method & calback names are different? 即如果AppAHub和AppBHub想要很好地玩,他们需要确保他们的方法和回调名称不同吗? Or are they already different as long as the hub names are different? 或者只要集线器名称不同,它们是否已经不同?
  3. Assuming it's "safe enough", does it "scale out" well to have each app sifting through each other app's messages. 假设它“足够安全”,它是否可以“扩展”以使每个应用程序筛选彼此的应用程序消息。 Is it worth it to have a separate backplane at some scale. 在某种程度上有一个单独的背板是否值得。 Is it worth it at a small scale? 是否值得小规模? eg: 2 types of hub, 2 instances of each. 例如:2种类型的集线器,每种集线器2个实例。
  4. Alternately there is the possibility that AppAHub and AppBHub could really be just two interfaces into the same hub, so AppA can potentially stay informed about AppB & vice versa. 或者,AppAHub和AppBHub可能只是两个接口进入同一个集线器,因此AppA可能会随时了解AppB,反之亦然。 I wonder if there's any point in them being separate hubs if we know they'll all be fed everything. 我想知道如果我们知道他们都会被送到一切,他们是否有任何一点是独立的枢纽。 OR does that activate some unavoidable additional cost for AppA now that it more explicitly "cares" about AppB messages? 或者这会为AppA激活一些不可避免的额外成本,因为它更明确地“关注”AppB消息吗?

Hub are stand alone , so different hubs play nice , how ever if you place them in different assembly and want to access each other , see here 集线器是独立的,所以不同的集线器运行良好,如果你把它们放在不同的组件中并想要互相访问,请参见此处

names and callback are based on which hub your client connects to , they should be unique for debugging purposes, if you client connects to 1 or more different hub if each client connects to only one hub 名称和回调基于客户端连接到哪个集线器,如果客户端连接到一个或多个不同的集线器(如果每个客户端仅连接到一个集线器),则它们应该是唯一的用于调试目的

for performance counter, see here , Microsoft uses signlR back plane in their azure web services , so it does scale however there is not published whitepapers on the benchmark figures 对于性能计数器,请参阅此处 ,Microsoft在其天蓝色Web服务中使用signlR背板,因此它确实可以扩展,但基准数据上没有发布白皮书

If you want to use the interfaces approach IAppAHub and IAppBHub your java script client can call IAppAHub and IAppBHub methods , if you want to limit you can to it by role for that you should look into SignalR securty 如果你想使用接口方法IAppAHub和IAppBHub,你的java脚本客户端可以调用IAppAHub和IAppBHub方法,如果你想限制你可以通过角色来调用它,你应该调查一下SignalR securty

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

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