Good morning again,
After many test, only slow when has many dependencies in the appservice.
We resolve that for the moment using LazyServiceProvider, now the endpoint is faster.
Good morning,
I can't give you the solution as it is the company's project.
We would have to try to replicate it in a project of approximately 100 entities.
| Solution | Entity Count | DbContext Size | Cold Start Time | |---|---|---|---| | Current (Large) | ~XXX entities | Large/Complex | 6,900ms | | Comparison (Small) | ~XX entities | Small/Simple | 600ms |
ABP Framework's cold start performance degrades exponentially with DbContext size:
How can it take so long to bring 7 records?
We have a critical systematic performance issue where all AppServices experience significant delays during cold start. The key finding is that the delay occurs AFTER the business logic method completes execution, not during initialization or business logic execution. Impact: 15.1x performance degradation with 6,444ms unexplained delay in ABP's post-method pipeline.
The method is executed but when is finished take many seconds (3 - 7 seconds) in all enviroments. When is the fist call, the second is very quick.
1. Timing Analysis • Business Logic Execution: 456ms (fast) • Total HTTP Request Time: 6,900ms (extremely slow) • Delay Location: Post-method execution, within ABP pipeline • Silent Gap: 6,444ms of unexplained processing
2. Affected Components • All ABP AppServices: Experience cold start delays • Non-ABP Controllers: No delays (normal performance) • Direct Repository Access: Fast execution
Test Implementation We created three identical implementations to isolate the issue:
// Added to all test methods var stopwatch = Stopwatch.StartNew(); stopwatch.Stop();
KEY FINDING: In AppServices, there is a 6,444ms gap between:
During this gap: • ❌ No logs from our application code • ❌ No logs from business logic • ❌ No logs from Entity Framework • ❌ No visible processing activity • ✅ Something is consuming 6,444ms silently
| Implementation | Business Logic | Method Total | HTTP Total | Silent Gap | Performance Factor | |---|---|---|---|---|---| | ABP AppService | 334ms (245+89) | 456ms | 6,900ms | 6,444ms | 15.1x slower | | Custom AppService | 265ms (198+67) | 287ms | 378ms | 91ms | 1.3x | | Direct Controller | 211ms (164+47) | 222ms | 289ms | 67ms | 1.3x |
All Environment (Local and Release) • First request to any AppService: 6.9+ second delay or apply any filter (if second time apply filter is quick) • API responsiveness: Severely degraded on cold start • System scalability: Cold starts occur frequently in cloud environments
Question: What specific components run in ABP AFTER method completion? • Response serialization • Authorization post-processing • Audit logging • Unit of Work finalization • Result caching/compression • Other interceptors or middleware
Question: Are there lazy-loaded components that initialize on first use?
• AutoMapper configuration compilation • Validation rule compilation • Permission checking cache • Other reflection-based components
Depends the appservice it takes between 3-7 seconds to execute and up to 11 seconds in Production.
Hello, Can you give me your email?
Exception message and full stack trace: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (258): The wait operation timed out. at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) ClientConnectionId:656a9e0f-2c21-432d-808d-c96136b6a32e
Steps to reproduce the issue: When trying to insert 3000 records.
I have a method to CreateAsync, this metod create a header of entity and insert child entities. In this case insert 3000 child records in same method, in debuggin the method is executed in 2 seconds but the call of the service can last more than 3 minutes.
Any problem with the Unit of Work? Any ideas on how to tackle this problem? It should be a fairly quick process even with more records,
Thank you,
Hi, We have recently implemented the PWA and I think we have a bit of a problem.
I have been reading the documentation: https://abp.io/docs/latest/framework/ui/blazor/pwa-configuration
We use the service-workers that come by default in the ABP template,
We have updated a few versions of nugets in the application and accessed the published application, The problem is that when we accessed the web through the Chrome browser, the changes of the new versions were not applied, it seemed that they were using a previous version because it did not work as expected, correcting an error,
This is stated in your documentation:
"The service-worker.published.js file, which is used after the app is published. Caches certain file extensions and supports offline scenarios by default (uses a cache-first strategy). A user must first visit the app while they're online. The browser automatically downloads and caches all of the resources required to operate offline and then when the network connection is disconnected, it can be used like before."
In the Chrome browser I had to clear the cache so that it would detect the new changes, Can it be related to having the PWA?
It works, thanks a lot
Hi, we have a problem override AbpExceptionFilter.
We have this class override the methods
In the host module, replace the services, for the class DefaultExceptionToErrorInfoConverter it works
in application initialization we added this code to verified if replace the class, returns SmcExceptionFilter
And in program host class also debugging and check
But when the exception is triggered, the debugging point stops in the class of AbpExceptionFilter
Any points to check why this might happen?