Base solution for your next web application
Open Closed

Slow Requests #12476


User avatar
0
ricardo created

Hi,

Plataform : AspnetCore MVC

We recently deployed our solution in production on Azure.The database is in the Hyperscale layer: PRMS, 2 vCores, the application is allocated in the Premium Layer with 2Vcpu/8GB of Memory running in 3 instances. We also added Azure Redis Cache in the Standard tier, as well as the Azure Signal R backpane. We configured Redis to use PerRedisCache.

However, we are experiencing random slowdowns that we cannot identify the origin of:

Azure telemetry shows all resources with low utilization.

For example, a request to AbpScrips/GetScripts took almost two minutes to return. Looking at the Azure Log, after the commit after the last query, there was a huge wait time, which we were unable to identify the source of in the logs.

If you need it, I can send you the traces generated by Azure.

I would really like your help in pointing out a path that we can follow. Since there are plenty of resources:

Databse Server:

AppServer

Redis

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

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

    Hi @ricardo

    Can you share with us your ASP.NET Boilerplate (ABP) version in your project where you are experiencing this issue?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ricardo created

    Hi @oguzhanagir

    AbpVersion: 10.1.0

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ricardo

    You can help fix this with Azure's "Application Initialization" feature. Just set it up to "warm up" your slow pages, like /AbpScripts/GetScripts, before any users visit them. This gets the app ready and avoids the long wait.

    If you're still having trouble after that, please email your detailed logs to us at [email protected] so we can take a closer look.

    Thank you

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ricardo created

    Hi @oguzhanagir,

    the slowness does not occur after the server starts, it is random and does not only happen in /AbpScripts/GetScripts, see the print of a request:

    GetProfilePicture and GetTenantLogo in this request took more than 20s each.It is usually in the millisecond range.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ricardo

    Thank you for your explanation. Could you please share the logs of the records with long request durations with us at [email protected] so that we can investigate further in more detail?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ricardo created

    Hi @oguzhanagir

    I sent two emails to [email protected]

    Problems continue to occur quite frequently

    tanks.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ricardo

    Thank you for sending the details via email. We will review the situation and get back to you as soon as possible. Thank you.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ricardo

    You can override the default IOnlineClientStore registration provided by UseRedis() using the following code

    Configuration.IocManager.IocContainer.Register(
        Castle.MicroKernel.Registration.Component
            .For<IOnlineClientStore>()
            .ImplementedBy<TecsmartRedisOnlineClientStore>()
            .LifestyleSingleton()
    );
    

    This approach ensures that TecsmartRedisOnlineClientStore will always be used, even if UseRedis() has already registered a different implementation like RedisOnlineClientStore.

    if (_env.IsProduction())
    {
        Configuration.IocManager.IocContainer.Register(
           Castle.MicroKernel.Registration.Component
                .For<IOnlineClientStore>()
                .ImplementedBy<TecsmartRedisOnlineClientStore>()
                .LifestyleSingleton()
        );
    
        //Usa Cache do Redis somente em Produção
        Configuration.Caching.UseRedis(options =>
        {
            options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
            options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");
    
        }, usePerRequestRedisCache: true);
    }
    

    This is necessary because the registration inside UseRedis() uses RegisterIfNot, meaning it only registers RedisOnlineClientStore if no previous registration exists. So, by explicitly registering your custom implementation before or after UseRedis(), you can safely override the default.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)