Hi,
While we create a new tenant on azure it takes almost 3 to 5 minutes to create a new tenant. While analyzing where exactly it is taking time, we found that the following statement in the TenantManager.cs class takes too much of time to finish execution. _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);
Any idea what must be wrong? Please advice how can we increase the performance of creating a new tenant?
Regards, Mahendra
9 Answer(s)
-
0
Hi @pankajmathur,
This method creates a new database and applies migrations on that database. I think this is probably something on azure side you can try to improve performance.
-
0
Hi,
Apart from slow performance, it also throws Internal Error at times. The error is not consistent in nature, At times it creates the tenant successfully (though its slow), but at times it also fails. When it fails, it even not creates the database. The internal error that gets thrown at times is what we are more worried about. We have around 50 tables apart from the one that ABP and ASPNetZero have. Please advice...
Regards, Mahendra
-
0
You would need to provide the errors. Also have you tested against a local SQL box to determine if it just Azure? My guess is its Azure and something might need to be tweaked on the context to allow for longer time outs or a setting.
-
0
Yes, I am trying to creating tenant on Azure. At times it creates successfully. But at times it fails with the following error. Please advice.
Exception: System.InvalidOperationException: Internal .Net Framework Data Provider error 6. at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0
2.b__0(DbContext c, TState s) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func
3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func2 operation, Func
2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Create() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrate(AbpTenantBase tenant, Action
1 seedAction) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrateForTenant(AbpTenantBase tenant, Action
1 seedAction) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrateForTenant(AbpTenantBase tenant) at CitiXsys.iVend365.MultiTenancy.TenantManager.d__15.MoveNext() in D:\Development\CXSRetail\Development\iVend365\src\CitiXsys.iVend365.Core\MultiTenancy\TenantManager.cs:line 192 -
0
Also, I have following timeout set
public iVend365DbContext(DbContextOptions<iVend365DbContext> options) : base(options) { Database.SetCommandTimeout(1000); }
-
0
Its related to azure not AspNetZero from what I can tell. Seem to be a common issue with Azure and Elastic DBs
<a class="postlink" href="https://stackoverflow.com/questions/42027191/internal-net-framework-data-provider-error-6-in-sql-azure">https://stackoverflow.com/questions/420 ... -sql-azure</a>
-
0
Do you recommend any workaround or suggestion?
-
0
@pankajmathur, you could trying temporarily bumping up the level is SQL Server service/performance. See if that makes any difference....
-
0
Sorry, we dont use azure. We have our own SQL cluster.