Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Azure cloud hosting with multiple instances #9758


User avatar
0
ivanosw1 created

Hi, I need to run two or more instance of ABP (AspNetCore + Angular version >=9.1.0) hosted in Azure AppService (Docker or files deploy) with autobalancing. There are many things to consider when two instance are running simultaneously. AspnetZero provide a out-of-box solution for shared cache with native Redis support. But what about background and recurring jobs? And what about SignalR ? These services cannot run twice in the same time otherwise data locks, data duplicates and many other problems can happen.

How do you sugguest to setup AspNetZero to support this scenario? Thank you for your advices


8 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ivanosw1

    1. what about background and recurring jobs?

    For this, you can use Hangfire or if you want to use ABP's default implementation, you can enable background jobs in just 1 instance and disable on others.

    1. what about SignalR ?

    You can use Azure SignalR service which works out of the box with AspNet Zero.

  • User Avatar
    0
    ivanosw1 created

    I must do a clarification about the question no 1.

    The instances are created by Azure loadbalancer automatically and I don't know which and how many instances are running at same time. So is not possible apply your suggestion.

    All background/jobs's system I think should have an interface like the Cache, so you can replace with a external well known scheduler service.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, you can easily use Hangfire, see https://aspnetboilerplate.com/Pages/Documents/Hangfire-Integration.

  • User Avatar
    0
    ivanosw1 created

    Ok, That's a great thing !! I had missed this detail beacause we use quartz. Thank you.

  • User Avatar
    0
    ivanosw1 created

    But, wait a moment. Hangfire is integrated in Aspnet zero, so, two instance of aspnet zero has two instance of hangfire. The problem is still alive.

  • User Avatar
    0
    ivanosw1 created

    Hi, some news about this topic? Is very important for a cloud based installation.

    Thank you.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ivanosw1

    As far as I remember, latest version of Hangfire handles this situation. Did you have a chance to try it ?

  • User Avatar
    0
    ivanosw1 created

    Ok @ismcagdas

    I'll look more deeply in Hangfire configuration.

    I suppose your are interested too about this topic and I'll need your technical support to evaluate eventually changes to apply to AspNetZero in order to support multi instances.

    It'll take some time and so for the moment I close the ticket.