Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration
button.
- ABP Framework version: v9.1
- UI Type: Blazor Server
- Database System: EF Core (PostgreSQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): NO
- Exception message and full stack trace:
- Steps to reproduce the issue:
Signin Manager becomes slow.
I have a custom login where I have 1 database per tenant, have a table with user - tenant mapping.
try { var tenantId = user.AssignedTenantId == null ? (Guid?)null : Guid.Parse(user.AssignedTenantId); // get the tenant for the user using (CurrentTenant.Change(tenantId)) { return await base.OnPostAsync(action); ** // this takes 4-6 seconds. ** } }
workaround :
- When I login to the master (host) site. and then login it is faster. Any reasons why?
-------.. side note ---------- I switched off redis cache - not sure if its related. just mentioning here. it makes the API go slow. I use AZURE REDIS. I tested with a console app and azure redis seems to be fine, fast etc. somehow when i enable it makes all my API go really slow. so switched off.
"Redis": { "IsEnabled": false, "Configuration" : XXXX }
9 Answer(s)
-
0
hi
Please enable the debug logs and share the logs for your slow HTTP request..
https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems
Thanks.
-
0
I enabled openiddict logs.
Download from here. https://drive.google.com/drive/folders/1Ugr2wnGVpYbY-VK-Z0f_YkT2ieE0Zwyn?usp=drive_link
-
0
-
0
-
0
hi
Can you try to override the
IWebClientInfoProvider
and test again?See https://github.com/abpframework/abp/issues/23029 https://github.com/abpframework/abp/pull/23032
Thanks.
-
0
I added this code in the blazor project. Is that correct? I can try now and test it.
`
Using System; using System.Net; using System.Runtime.CompilerServices; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Caching.Memory; using MyCSharp.HttpUserAgentParser; using MyCSharp.HttpUserAgentParser.Providers; using Volo.Abp.AspNetCore.WebClientInfo; using Volo.Abp.DependencyInjection;
///
/// A high-performance web client info provider that caches browser and device information /// [Volo.Abp.DependencyInjection.Dependency(ReplaceServices = true)] [ExposeServices(typeof(IWebClientInfoProvider))] public class CachedHighPerformanceWebClientInfoProvider : IWebClientInfoProvider, ISingletonDependency { private const int CacheExpirationMinutes = 30; // Longer expiration since UA strings don't change often private readonly IMemoryCache _cache; private readonly IHttpContextAccessor _httpContextAccessor; private readonly IHttpUserAgentParserProvider _parserProvider;public CachedHighPerformanceWebClientInfoProvider( IHttpContextAccessor httpContextAccessor, IMemoryCache cache) { _httpContextAccessor = httpContextAccessor; _cache = cache;
// Initialize the parser provider once _parserProvider = new HttpUserAgentParserDefaultProvider(); } .... ....<< same as code as the link you shared >> ... `` `
-
0
hi
Yes, add it to the
Account/Login
project. -
0
Ok I added them and its now consistently < 1second. I am not sure if it fixed it or some sort of caching. Usually, when i push a new change, the login tends to be slow again. I will run a few test and get back to you
-
0
ok