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

Performance issues in dotnet core with angular app #8971


User avatar
0
OriAssurant created

Hi , We are running into performance issues with the .net core with angular app. Can you please guide in the best way to help improve performance

  1. Are there libraries that come with aspnetzero / abp that we're not using that could be deleted? or not allow to load at start up ?

  2. Are there resources that it would make sense to delay loading until after login page (like do in parallel with Okta login API call or load in background after user hits the main landing page )?

  3. How can we Ensure all .css and .js is minified for all our environments ?> Is there a common place we can do that ?


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

    Hi @OriAssurant,

    Could you share the url of your public app with [email protected] ? We can chech the app init time and try to help you.

  • User Avatar
    0
    OriAssurant created

    Thanks for your response. We still have not deployed to prod. The performance issues are happening in our QA Environment. The current getall() method takes 20+ seconds to load. I attached the screenshot. Also i am looking to minify all css and js files. If you can please help where to do it. thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    When using Angular app, all your styles and scripts are minified, you don't need to make any configuration about this. Do you see any non-midified style or script file ? GetAll method (I assume it is AbpUserConfiguration/GetAll) normally shouldn't take that much long. Could you investigate your log file and see which action gets longer time when GetAll method is executed.

    Thanks,

  • User Avatar
    0
    OriAssurant created

    Hi , I am attaching the logs for login page to landing page . Can you please help me identify the areas to improve the performance of the landing page. Thanks . Also i am not able to attached the entire logs. its exceeds the max allowed limit.

    INFO 2020-05-08 14:18:34,129 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/api/services/app/Account/IsTenantAvailable?d=1588961914108
    INFO 2020-05-08 14:18:34,129 [48 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,130 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.3723ms 204 INFO 2020-05-08 14:18:34,142 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST https://api.alservices.com:4430/api/services/app/Account/IsTenantAvailable?d=1588961914108 application/json 23 INFO 2020-05-08 14:18:34,143 [48 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,144 [48 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Assurant.Majestic.Authorization.Accounts.AccountAppService.IsTenantAvailable (Assurant.Majestic.Application)' INFO 2020-05-08 14:18:34,148 [48 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "app", action = "IsTenantAvailable", controller = "Account"}. Executing controller action with signature System.Threading.Tasks.Task1[Assurant.Majestic.Authorization.Accounts.Dto.IsTenantAvailableOutput] IsTenantAvailable(Assurant.Majestic.Authorization.Accounts.Dto.IsTenantAvailableInput) on controller Assurant.Majestic.Authorization.Accounts.AccountAppService (Assurant.Majestic.Application). INFO 2020-05-08 14:18:34,148 [48 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,157 [48 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Assurant.Majestic.Authorization.Accounts.AccountAppService.IsTenantAvailable (Assurant.Majestic.Application) - Validation state: Valid INFO 2020-05-08 14:18:34,162 [48 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Assurant.Majestic.Authorization.Accounts.AccountAppService.IsTenantAvailable (Assurant.Majestic.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 5.2523ms. INFO 2020-05-08 14:18:34,258 [24 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2020-05-08 14:18:34,258 [24 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Assurant.Majestic.Authorization.Accounts.AccountAppService.IsTenantAvailable (Assurant.Majestic.Application) in 109.6793ms INFO 2020-05-08 14:18:34,258 [24 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Assurant.Majestic.Authorization.Accounts.AccountAppService.IsTenantAvailable (Assurant.Majestic.Application)' INFO 2020-05-08 14:18:34,259 [24 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 116.569ms 200 application/json; charset=utf-8 INFO 2020-05-08 14:18:34,272 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/AbpUserConfiguration/GetAll?d=1588961914265 INFO 2020-05-08 14:18:34,273 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,273 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.358ms 204 INFO 2020-05-08 14:18:34,290 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET https://api.alservices.com:4430/AbpUserConfiguration/GetAll?d=1588961914265 application/json INFO 2020-05-08 14:18:34,290 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,290 [90 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore)' INFO 2020-05-08 14:18:34,293 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetAll", controller = "AbpUserConfiguration", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.JsonResult] GetAll() on controller Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController (Abp.AspNetCore). INFO 2020-05-08 14:18:34,293 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,296 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) - Validation state: Valid INFO 2020-05-08 14:18:34,524 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore), returned result Microsoft.AspNetCore.Mvc.JsonResult in 227.8517ms. INFO 2020-05-08 14:18:34,888 [90 ] matters.Json.Internal.JsonResultExecutor - Executing JsonResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2020-05-08 14:18:34,890 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) in 596.1298ms INFO 2020-05-08 14:18:34,890 [90 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore)' INFO 2020-05-08 14:18:34,890 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 600.5362ms 200 application/json; charset=utf-8 INFO 2020-05-08 14:18:34,944 [92 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/api/services/app/Session/GetCurrentLoginInformations
    INFO 2020-05-08 14:18:34,944 [92 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,944 [92 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.2959ms 204 INFO 2020-05-08 14:18:34,959 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET https://api.alservices.com:4430/api/services/app/Session/GetCurrentLoginInformations
    INFO 2020-05-08 14:18:34,959 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,959 [90 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Assurant.Majestic.Sessions.SessionAppService.GetCurrentLoginInformations (Assurant.Majestic.Application)' INFO 2020-05-08 14:18:34,962 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "app", action = "GetCurrentLoginInformations", controller = "Session"}. Executing controller action with signature System.Threading.Tasks.Task1[Assurant.Majestic.Sessions.Dto.GetCurrentLoginInformationsOutput] GetCurrentLoginInformations() on controller Assurant.Majestic.Sessions.SessionAppService (Assurant.Majestic.Application). INFO 2020-05-08 14:18:34,962 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:34,967 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Assurant.Majestic.Sessions.SessionAppService.GetCurrentLoginInformations (Assurant.Majestic.Application) - Validation state: Valid INFO 2020-05-08 14:18:35,008 [92 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Assurant.Majestic.Sessions.SessionAppService.GetCurrentLoginInformations (Assurant.Majestic.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 41.0453ms. INFO 2020-05-08 14:18:35,009 [92 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2020-05-08 14:18:35,009 [92 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Assurant.Majestic.Sessions.SessionAppService.GetCurrentLoginInformations (Assurant.Majestic.Application) in 47.2544ms INFO 2020-05-08 14:18:35,009 [92 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Assurant.Majestic.Sessions.SessionAppService.GetCurrentLoginInformations (Assurant.Majestic.Application)' INFO 2020-05-08 14:18:35,009 [92 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 50.8172ms 200 application/json; charset=utf-8 INFO 2020-05-08 14:18:35,778 [102 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/api/TokenAuth/GetExternalAuthenticationProviders INFO 2020-05-08 14:18:35,779 [102 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:35,779 [102 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.55ms 204 INFO 2020-05-08 14:18:35,784 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET https://api.alservices.com:4430/api/TokenAuth/GetExternalAuthenticationProviders INFO 2020-05-08 14:18:35,785 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:35,785 [90 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core)' INFO 2020-05-08 14:18:35,789 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetExternalAuthenticationProviders", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Collections.Generic.List1[Assurant.Majestic.Web.Models.TokenAuth.ExternalLoginProviderInfoModel] GetExternalAuthenticationProviders() on controller Assurant.Majestic.Web.Controllers.TokenAuthController (Assurant.Majestic.Web.Core). INFO 2020-05-08 14:18:35,789 [90 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:35,795 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core) - Validation state: Valid INFO 2020-05-08 14:18:35,796 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 0.0122ms. INFO 2020-05-08 14:18:35,798 [102 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET https://api.alservices.com:4430/api/TokenAuth/GetExternalAuthenticationProviders
    INFO 2020-05-08 14:18:35,798 [102 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:35,798 [102 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core)' INFO 2020-05-08 14:18:35,801 [102 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetExternalAuthenticationProviders", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Collections.Generic.List`1[Assurant.Majestic.Web.Models.TokenAuth.ExternalLoginProviderInfoModel] GetExternalAuthenticationProviders() on controller Assurant.Majestic.Web.Controllers.TokenAuthController (Assurant.Majestic.Web.Core). INFO 2020-05-08 14:18:35,801 [102 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:35,810 [102 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core) - Validation state: Valid INFO 2020-05-08 14:18:35,811 [102 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 0.0198ms. INFO 2020-05-08 14:18:35,819 [24 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2020-05-08 14:18:35,820 [24 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core) in 31.4123ms INFO 2020-05-08 14:18:35,820 [24 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core)' INFO 2020-05-08 14:18:35,820 [24 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 36.0866ms 200 application/json; charset=utf-8 INFO 2020-05-08 14:18:35,848 [90 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'. INFO 2020-05-08 14:18:35,849 [90 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core) in 47.6061ms INFO 2020-05-08 14:18:35,849 [90 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Assurant.Majestic.Web.Controllers.TokenAuthController.GetExternalAuthenticationProviders (Assurant.Majestic.Web.Core)' INFO 2020-05-08 14:18:35,849 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 51.2456ms 200 application/json; charset=utf-8 INFO 2020-05-08 14:18:41,695 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/api/TokenAuth/ExternalAuthenticate
    INFO 2020-05-08 14:18:41,695 [48 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:41,695 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.2697ms 204 INFO 2020-05-08 14:18:41,707 [24 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST https://api.alservices.com:4430/api/TokenAuth/ExternalAuthenticate application/json 1230 INFO 2020-05-08 14:18:41,707 [24 ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful. INFO 2020-05-08 14:18:41,707 [24 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Assurant.Majestic.Web.Controllers.TokenAuthController.ExternalAuthenticate (Assurant.Majestic.Web.Core)'

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    According to logs, this takes 7 seconds. But there is a strange log here;

    INFO 2020-05-08 14:18:35,849 [90 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 51.2456ms 200 application/json; charset=utf-8
    INFO 2020-05-08 14:18:41,695 [48 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS https://api.alservices.com:4430/api/TokenAuth/ExternalAuthenticate
    

    Is there any other log between those two ? Could you send entire log file to [email protected] ?

    Thanks,

  • User Avatar
    0
    OriAssurant created

    Hi , thanks for you response. As i told you i could not attached the entire logs because of the limit you have on the code . The first load its generates 300+ lots lines of logs. We are delaying too much of critical time as we need to fix this performance issue asap. Is there a time we can set up and get this done quickly. Thanks

  • User Avatar
    0
    OriAssurant created

    Hi ANZ guys ,we have deployed the app here for you to take look at the performance . Can you please guide us on the loading page and the areas where we can have an improve in performance ? https://demoqa.assurantlogistics.com username : adminqa password : Qwerty123$

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi **@OriAssurant **,

    Yes, I can see that AbpUserConfiguration/GetAll takes around 7 seconds. Do you use Redis in your application ? It might be related to that.

  • User Avatar
    0
    OriAssurant created

    No we dont use redis at all. How to get control of all of the libraries/features used by GetAll ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can do it like this;

    First, create a controller (for example MyAbpUserConfigurationController) similar to https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Controllers/AbpUserConfigurationController.cs

    Then, implement a class similar to https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Common/Web/Configuration/AbpUserConfigurationBuilder.cs (for example MyAbpUserConfigurationBuilder).

    Then use, MyAbpUserConfigurationBuilder in MyAbpUserConfigurationController and change GetAll request url to MyAbpUserConfigurationController/GetAll.

    After all, you can see which operation on https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Common/Web/Configuration/AbpUserConfigurationBuilder.cs#L77 takes longer time than others.