Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure sql database Azure SQL-System.ComponentModel.Win32异常:等待操作超时_Azure Sql Database - Fatal编程技术网

Azure sql database Azure SQL-System.ComponentModel.Win32异常:等待操作超时

Azure sql database Azure SQL-System.ComponentModel.Win32异常:等待操作超时,azure-sql-database,Azure Sql Database,我有一个MVC Azure Web应用程序,使用Azure SQL数据库 我刚刚在本地机器上完成了一个新版本的开发,并将其发布到Azure测试环境中,但它的行为有点奇怪:系统的某些部分工作正常,但有一个特定部分(此版本未更改)给了我以下错误: System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of t

我有一个MVC Azure Web应用程序,使用Azure SQL数据库

我刚刚在本地机器上完成了一个新版本的开发,并将其发布到Azure测试环境中,但它的行为有点奇怪:系统的某些部分工作正常,但有一个特定部分(此版本未更改)给了我以下错误:

System.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 (0x80004005): The wait operation timed out

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTdsWithTransparentParameterEncryption(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest, Task describeParameterEncryptionTask)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)

   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)

   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters)

   at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass69`1.<ExecuteStoreQueryReliably>b__68()

   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)

   at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass69`1.<ExecuteStoreQueryReliably>b__67()

   at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)

   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryReliably[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters)

   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQuery[TElement](String commandText, ExecutionOptions executionOptions, Object[] parameters)

   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()

   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
System.Data.SqlClient.SqlException(0x80131904):执行超时已过期。操作完成前已过超时时间,或者服务器没有响应。
--->System.ComponentModel.Win32Exception(0x80004005):等待操作超时
位于System.Data.SqlClient.SqlConnection.OneError(SqlException异常,布尔断开连接,操作'1 wrapCloseInAction)
位于System.Data.SqlClient.TdsParser.ThroweException和Warning(TdsParserStateObject StateObjectStateObj、布尔调用方连接锁、布尔异步关闭)
位于System.Data.SqlClient.TdsParser.TryRun(RunBehavior RunBehavior、SqlCommand cmdHandler、SqlDataReader dataStream、BulkCopySimpleResultSet bulkCopyHandler、TdsParserStateObject stateObj、Boolean和dataReady)
位于System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()处
在System.Data.SqlClient.SqlDataReader.get_MetaData()处
位于System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds、RunBehavior RunBehavior、String ResetOptions String、Boolean isInternal、Boolean ForDescriptionParameterEncryption)
位于System.Data.SqlClient.SqlCommand.RunExecuteReaderDS(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、Boolean async、Int32超时、任务和任务、Boolean asyncWrite、Boolean inRetry、SqlDataReader ds、Boolean describeParameterEncryptionRequest)
位于System.Data.SqlClient.SqlCommand.RunExecuteReaderDSWithTransparentParameterEncryption(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、Boolean async、Int32超时、任务和任务、Boolean asyncWrite、Boolean inRetry、SqlDataReader ds、Boolean describeParameterEncryptionRequest、Task describeParameterEncryptionTask)
位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法、TaskCompletionSource`1完成、Int32超时、任务和任务、Boolean和usedCache、Boolean asyncWrite、Boolean inRetry)
位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法)
位于System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior,String方法)
在System.Data.Entity.Infrastructure.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget目标,Func`3操作,TInterceptionContext拦截Context,操作`3执行,操作`3执行)
位于System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand命令,DbCommandInterceptionContext interceptionContext)
位于System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText,String entitySetName,ExecutionOptions ExecutionOptions,Object[]参数)
在System.Data.Entity.Core.Objects.ObjectContext.c__DisplayClass69`1.b__68()中
在System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 Func,IDBEcutionStrategy executionStrategy,Boolean startLocalTransaction,Boolean releaseConnectionOnSuccess)
在System.Data.Entity.Core.Objects.ObjectContext.c__DisplayClass69`1.b__67()中
在System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1操作)中
位于System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryReliably[TElement](String commandText,String entitySetName,ExecutionOptions ExecutionOptions,Object[]参数)
位于System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQuery[TElement](String commandText,ExecutionOptions ExecutionOptions,Object[]参数)
位于System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
在System.Linq.Enumerable.First[TSource](IEnumerable`1 source)处
失败的部分调用存储过程以生成一些管理信息。它在我的本地环境和生产现场工作正常,但在测试环境中失败。在工作的环境中,运行只需几分之一秒


测试系统的其他部分工作正常,性能与往常一样。

结果表明,问题在于数据库的定价层

到目前为止,我一直在运行基本级别的测试数据库,以降低成本。基本级别支持高达2GB的数据库

当我导入生产数据库的最新副本时,它小于2GB,因此允许我选择Basic,但这没有为导致问题的存储过程使用的临时表留出足够的空间

当我切换到标准定价层并将数据库的最大大小增加到5GB时,问题就消失了