简体   繁体   English

超时已过。 操作完成前超时时间已过或服务器未响应。 从数据库中获取记录时

[英]Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. While fetching records from database

I have many users on my web site (2000000 per day) in my database, While fetching data from database im getting above error.我的网站上有很多用户(每天 2000000 个)在我的数据库中,而从数据库中获取数据时,我遇到了上述错误。 I've received "Server is unavailable" errors before, but am now seeing a connection timeout error.我之前收到过“服务器不可用”错误,但现在看到连接超时错误。 I'm not familiar with this - why does it occur and how can I fix it?我不熟悉这个 - 为什么会发生,我该如何解决?

   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at MySql.Data.Common.MyNetworkStream.HandleOrRethrowException(Exception e)
   at MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)```

Plenty of reasons:原因很多:

  1. The query is taking too long to execute.查询执行时间过长。 As the tables have increased in size, the queries are getting slower and slower due to bad design.随着表的大小增加,由于糟糕的设计,查询变得越来越慢。 Check if this happens during the execution of a specific query or table to narrow down the investigation area检查在执行特定查询或表期间是否发生这种情况以缩小调查范围
  2. Network issues.网络问题。 These are errors due to connectivity issues.这些是由于连接问题导致的错误。 The network is unstable etc. This should be taken up with your provider or administrator.网络不稳定等。这应该与您的提供商或管理员联系。
  3. Returning huge amount of data.返回大量数据。 If you try to return millions of rows to the c# callier, it could be that it's taking too long to fetch.如果您尝试将数百万行返回给 c# 调用程序,则可能是获取时间太长。 Try using paging or limit the rows by selecting the top X rows尝试使用分页或通过选择顶部 X 行来限制行

It's really very hard to tell, without having some more information, like the query that it's failing, the database schema and indexes for said tables, or the state of your services.如果没有更多信息,例如失败的查询、所述表的数据库架构和索引或服务状态,则很难判断。 The above are the most common cases I've seen.以上是我见过的最常见的情况。

You can also check for deadlocks and live locks.您还可以检查死锁和活锁。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 超时已过。 在操作完成之前超时时间已过或服务器没有响应。 该语句已终止 - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated 超时时间已到。 在操作完成之前超时或服务器没有响应。 在远程Windows .net上工作 - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. working on remote windows .net '执行超时已过期。 在操作完成之前超时时间已过或服务器没有响应。 - 'Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.' SQL Server异常:超时已过期。 操作完成之前经过的超时时间或服务器未响应 - SQL Server Exception:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding ExecuteQueryin linq:超时已过期。 操作完成之前经过的超时时间或服务器没有响应 - ExecuteQueryin linq :Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Linq Count() 超时 - 执行超时已过期。 操作完成前超时时间已过或服务器未响应 - Linq Count() timing out -Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding 超时时间已到。 操作完成之前经过的超时时间或服务器未响应 - Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding 超时时间已到。 操作完成之前经过的超时时间或服务器未响应 - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding 在sis中执行软件包会导致超时过期。 操作完成之前经过的超时时间或服务器未响应 - Execute package in ssis causes Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding 超时已过。 操作完成前超时时间已过或服务器未响应 - Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM