Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalability: using a pool of servers to receive, process and send message #12679

Open
Tracked by #23357
gopala000 opened this issue Jun 4, 2019 — with docs.microsoft.com · 5 comments
Open
Tracked by #23357
Labels
product-question SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue
Milestone

Comments

Copy link

I have a scenario where background service need to receive message, process the request and send back message to the requested client. I'd like to use a pool of servers for scalability. What is the architectural guidance to make sure that a message is processed only by one server in the pool?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue labels Jun 4, 2019
@bradygaster
Copy link
Member

@gopala000 are you also thinking of using the Azure SignalR Service? @chenkennt wrote a great blog post describing some new features like stickyness. see the post here: https://devblogs.microsoft.com/aspnet/whats-new-in-azure-signalr-1-1-0-preview-1/

If that's not what you're after let me know and i'll get more info for you on non-ASRS stickness.

@gopala000
Copy link
Author

gopala000 commented Jun 6, 2019

@bradygaster Thanks for your response. I'm not planning to use Azure SignalR Service. My scenario is

  1. Request originate from browser client
  2. Proxy translates it to a new signalR request to background service
  3. Background service process the request and sends the response to client

The example in the content under heading "React to signalR events with background service" has a "break" statement in while loop. That caused background service to end on single iteration. This seems wrong. My questions are

a. What should be the delay in the continuous while() loop?
b. In step #2 of my scenario, I used group as receiver of message with server name and processId in string to avoid more than one server process the request in a server farm. This works fine. Just wanted a validation if there is a better approach.

@Rick-Anderson Rick-Anderson added this to the Backlog milestone Jun 16, 2019
@udlose
Copy link

udlose commented Apr 20, 2020

I'd also like to know the guidance. This has been open for 10 months now. Can we have some guidance please? Would using Redis as a backplane solve this problem?

@bradygaster
Copy link
Member

adding @davidfowl here as he and I are discussing a series of updates on SignalR architecture. I think this would be near the top of the list of things we'd want to touch on.

@davidfowl
Copy link
Member

I don't understand the request so let me try to get some clarity (sorry for seeing this so late). Is this the architecture we're talking about (each box represents another machine):

[Client] <------> [ Server(s) ] <------> [ Workers with background service(s) ]

OR

[Client] <------> [ Server(s) with background service(s) ]

In short, do you want process messages in process or out of process?

I'll just state some relevant things:

  • If you want to send a message to a specific client where the request did not originate, you will need something like redis or another backplane even if you have SignalR.
  • If you want to offload work from the webserver to a worker service then you need a way to communicate to the worker service (redis, rabbitmq, service bus, pick a queue). If you want to respond to a client from the worker service then you need signalr + redis or you need to send an HTTP request back to the Server to forward the message to a specific client.

What is the architectural guidance to make sure that a message is processed only by one server in the pool?

I'm not sure I understand the question here. Which message, are you trying to send messages to clients or servers? What are you building?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-question SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

7 participants