SQL timeout errors in cs_user_Get

rated by 0 users
This post has 3 Replies | 1 Follower

Top 500 Contributor
Posts 89
Points 1,280
Ace Posted: Sat, Apr 7 2007 4:06 AM

I'm getting the SQL timeout error exception below, running CS 2.1.  I used the profiler to identify the offending query, which is the cs_user_Get proc.  It runs for 30 seconds and then times out.  The select from cs_Users alone was taking more than 15 seconds.  This feels like it might be a locking bug of some kind, since my cs_Users table only has a few thousand entries, and I have SQL running on a dedicated machine with plenty of RAM.  The problem eventually goes away, and the queries start running fast again.  However, in the mean time, the forum is pretty much unusable.

I haven't installed SP1 or SP2 yet, but since the problem isn't easily repeatable I thought I would post it anyway, in case it hasn't been fixed yet.

Ace

 

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857370
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734982
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
   System.Data.SqlClient.SqlDataReader.get_MetaData() +62
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +62
   CommunityServer.Data.SqlCommonDataProvider.GetUser(Int32 userID, String username, Boolean isOnline, Boolean isEditable, String lastAction) +366
   CommunityServer.Users.GetUserFromDataProvider(Int32 userID, String username, Boolean isOnline, Boolean isEditable) +56
   CommunityServer.Users.GetUser(Int32 userID, String username, Boolean isOnline, Boolean isCacheable) +1234
   CommunityServer.Components.CSContext.get_User() +61
   CommunityServer.CSHttpModule.Application_AuthorizeRequest(Object source, EventArgs e) +122
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Top 500 Contributor
Posts 89
Points 1,280
Ace replied on Sat, Apr 7 2007 11:42 AM

OK, I've completed the upgrade to SP2.  The earlier error hasn't recurred yet, but the one below is happening every time a moderator tries to delete a post in the forum.

 

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857370
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734982
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
   CommunityServer.Data.ForumsSqlDataProvider.ModeratorDeletePost(Int32 postID, Int32 deletedBy, String reason, Boolean deleteChildPosts) +368
   CommunityServer.Discussions.Controls.Moderate.DeletePost(ForumPost post, User moderatedBy, String reason, Boolean deleteChildPosts) +77
   CommunityServer.Discussions.Controls.DeletePost.DeletePost_Click(Object sender, EventArgs e) +133
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

  • | Post Points: 5
Top 10 Contributor
Posts 3,323
Points 73,040
MVPs

Ace,

You might find this thread useful.

http://communityserver.org/forums/t/481595.aspx

Regards,
Dave

 

  • | Post Points: 20
Top 500 Contributor
Posts 89
Points 1,280
Ace replied on Tue, Apr 10 2007 11:11 PM

I read the entire thread you mentioned, and I don't think the problems they're discussing are the same as what I experienced.

They were talking about a large number of calls to cs_user_Get, each of which was in the 20ms range.  What I'm seeing is a single call to cs_user_Get that can take *more than 30 seconds*.  The call takes so long that the ASP.NET apps times out.

They were also talking about indexes and their impact on query speed.  What I'm seeing looks more like a locking problem.

  • | Post Points: 5
Page 1 of 1 (4 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com