[英]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:原因很多:
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.