Hi,
Application : ASP.Net Core + Jquery Abp Version: 12.2.0
Please review the logs below. I would like to understand the first two lines—DbContext initialization and Initializing 3 localization sources. Why are they taking time, what operations are being performed during this phase, and is there any way we can optimize or reduce this time? Can we remove localization source Abp,AbpZero, AbpWeb ?
DEBUG 2025-05-27 12:25:41,034 [1 ] ameworkCore.AbpEntityFrameworkCoreModule - Registering DbContext: Ksoft.EntityFrameworkCore.KsoftDbContext, Ksoft.EntityFrameworkCore, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2025-05-27 12:27:10,760 [1 ] Abp.Localization.LocalizationManager - Initializing 3 localization sources. DEBUG 2025-05-27 12:27:10,809 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp DEBUG 2025-05-27 12:27:10,827 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpZero DEBUG 2025-05-27 12:27:10,835 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
1 Answer(s)
-
0
Hi @kansoftware
DbContext Initialization (~1 minute 29 seconds)
The delay is most likely due to slow database connectivity. When I performed this initialization locally, the DbContext initialization took ~314ms.
Common causes:
- Network latency between your application and the database server
- DNS resolution or incorrect connection string
- Heavy model creation if the DbContext has many entities or complex mappings
Recommendations:
- Test DB connectivity from the app host (e.g., ping or telnet to SQL port)
- Review SQL Server logs for long startup or blocking operations
- Temporarily enable EF Core’s EnableSensitiveDataLogging to pinpoint where it hangs
Localization Sources Initialization (75 milliseconds) Abp: 49ms AbpZero: 18ms AbpWeb: 8ms
This timing is completely normal and not a performance concern.
These localization sources come from built-in ABP modules and provide default translations (e.g., validation messages, permissions, audit logs). If you’re not using them (e.g., you're fully overriding localization), they can be removed, but the total gain is only ~75ms.
Note: This log entry is written at the start of the operation, so it doesn't reflect the actual duration. For accurate measurement, we recommend using a Stopwatch.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)