DEV Community

Cover image for How YOU can learn to build real-time Web Apps that scales, using .NET Core, C#, Azure SignalR Service and JavaScript

How YOU can learn to build real-time Web Apps that scales, using .NET Core, C#, Azure SignalR Service and JavaScript

Chris Noring on November 01, 2019

Follow me on Twitter, happy to take your suggestions on topics or improvements /Chris Ok, so you want to build real-time applications? There are ...
Collapse
 
xfischer profile image
Xavier Fischer • Edited

Hi Chris and thanks for sharing this.
Can you elaborate on costs? This one of the main issues I've had with Azure. Yes, it can scale, if you follow the rules, and build a nearly Azure dedicated architecture.

But when it will actually ramp up to the peak of "1 million chat users", how much will that really cost if we build this app and make it go live on Azure ?

Collapse
 
anthony profile image
Anthony Chu

It costs about $2/day per 1000 concurrent SignalR service connections. Generally if you have 1 million users, they are not connected at once. For Functions... it costs one execution for a function to send a message via SignalR Service, no matter how many devices are connected.

Collapse
 
xfischer profile image
Xavier Fischer • Edited

I did the maths to check, I may be wrong, please correct me if so.
I have used the Azure Pricing calculator.(azure.microsoft.com/en-us/pricing/...)

Let's imagine a real case where 1 million users would connect to and send only 1 message to test the chat room on a monthly basis.

  • Azure Functions cost : 0$ because the first million is free. Even if they send 10 messages, it's still cheap (2$ as you said)

Now, SignalR :

  • The free tier does not apply because it allows only 20 simultaneous connections
  • Standard tier starts at 41,30 € (max 1 million messages, max 1000 simultaneous connections per unit) (let's say 40$)

If we sum up, for a chat room like this (which is very well done and neat, Azure is great, no doubt on that) we have 42$/month.

And as for the 1000 users/day, that's only within the limit of approx 32 messages/user/day on a monthly basis. Pass that limit and you'll need two SignalR units, doubling the price.

Moreover:
If you have more than 1000 simultaneous users, how do you plug new ones to another unit ? This would double the messages sent ?

Am I wrong ?

Thread Thread
 
softchris profile image
Chris Noring

Hi Xavier. I've sent your question to the product team. Hope to get back to you soon :)

Thread Thread
 
xfischer profile image
Xavier Fischer

Hi Chris, so how did it go with the product team ?

Thread Thread
 
softchris profile image
Chris Noring

hi Xavier. I believe Anthony's first response is accurate. We are working on revamping the page for doing calculations on Cloud costs. Hopefully, this will become easier to use quite soon

Thread Thread
 
xfischer profile image
Xavier Fischer • Edited

So we have 60$/month on a 1000 users/day average on a monthly basis, based on Anthony's statement.

Please keep me and readers an posterity informed:

  • when the Azure pricing calculator will be "revamped" and will accurately evaluate costs (I can't believe the M of GAFAM shouldn't get this fixed within a couple days)
  • when you will be able to give a clear answer to the costs involved, as precise as the shiny tech bits delivered.

And one last question: Is really al this about technology or is it marketing ? If so, I promess I won't ask anything anymore.

Thread Thread
 
htissink profile image
Henrick Tissink

Really wish Chris finished off the thread - dealing with similar issues with signalr at the moment.

Thread Thread
 
xfischer profile image
Xavier Fischer

Cost issues ?

Thread Thread
 
htissink profile image
Henrick Tissink

wow, appreciate you replying 2 years after the comment :)

If you have more than 1000 simultaneous users, how do you plug new ones to another unit ? This would double the messages sent ?

mainly around that. We currently have a bunch of signalr pods on a single node, with a redis backplane on that same node, doing around 1 billion messages a month - imagine it's a stock trading app with price updates - but we're at a loss for scaling this out without a backplane, especially signalr onto other nodes. Have you solved an issue similar to ours? I would absolutely love just plugging into an azure service and making that headache an MS problem :P but it seems we're going to have to deal with this one on our own.

Thread Thread
 
xfischer profile image
Xavier Fischer

I was notified ;) I'm not the author, and no author replied to my questions neither. Seems that your problem is quite different : I was originally stating that omitting the real cost from the discussion was a bit unfair to the audience (ie marketing-like sponsored posts).
You seem to have the $$ so you may get an answer :)

Thread Thread
 
htissink profile image
Henrick Tissink

That is the peculiar thing lol, we do, and we really don't want to deal with this problem - but I think it's inevitable :) and I wholeheartedly agree, the marketing-like posts are all fun and jazzy but conveniently step over a lot of the pitfalls of this stuff, especially cost. MS page advises how to scale out with redis, cautions against it (in our case) but never really offers a good alternative.

Collapse
 
troywitthoeft profile image
Troy Witthoeft

Very nice. I've been wanting to try SignalR and Vue for awhile and this article is so well-written and easy to follow, I am going to dive in. Thanks!

Collapse
 
softchris profile image
Chris Noring

hi Troy. Thanks for that. Let me know if you have any questions :)

Collapse
 
sumitkharche profile image
Sumit Kharche

Great article!

Collapse
 
softchris profile image
Chris Noring

Thank you :)