ASP.NET Timeouts
-
Hello everybody-peeps. I have a ghastly problem that I need some help with. I have a stored procedure executing on SQL Server that is serving data to an asp.net webpage. Everything works fine until I try to execute a stored procedure that takes approximately 33 seconds to run. How on earth can I increase the timeout settings for all the potential points (web server, sql server etc, the application itself). Just so you know, I have increased my connection string timeout setting by adding the following phrase:'connection timeout=0;' Lets hope some of lovelies can sort me out on this...its probably straightforward for someone who knows, but that ain't me! :-O Gah! Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
-
Hello everybody-peeps. I have a ghastly problem that I need some help with. I have a stored procedure executing on SQL Server that is serving data to an asp.net webpage. Everything works fine until I try to execute a stored procedure that takes approximately 33 seconds to run. How on earth can I increase the timeout settings for all the potential points (web server, sql server etc, the application itself). Just so you know, I have increased my connection string timeout setting by adding the following phrase:'connection timeout=0;' Lets hope some of lovelies can sort me out on this...its probably straightforward for someone who knows, but that ain't me! :-O Gah! Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
hi, a) stored procedure is bad written, try write it better/faster b) increase ASP.NET timeout in web.config MSDN reference[^] should help bt let me know if not best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)
-
Hello everybody-peeps. I have a ghastly problem that I need some help with. I have a stored procedure executing on SQL Server that is serving data to an asp.net webpage. Everything works fine until I try to execute a stored procedure that takes approximately 33 seconds to run. How on earth can I increase the timeout settings for all the potential points (web server, sql server etc, the application itself). Just so you know, I have increased my connection string timeout setting by adding the following phrase:'connection timeout=0;' Lets hope some of lovelies can sort me out on this...its probably straightforward for someone who knows, but that ain't me! :-O Gah! Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
The timeout of the connection probably isn't the problem. That is just how long .NET will wait for a connection to be established with the database server. What you probably needs is the to set the
SqlCommand.CommandTimeout
. The default timeout is 30 seconds. Does this help?
Do you want to know more? WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
-
Hello everybody-peeps. I have a ghastly problem that I need some help with. I have a stored procedure executing on SQL Server that is serving data to an asp.net webpage. Everything works fine until I try to execute a stored procedure that takes approximately 33 seconds to run. How on earth can I increase the timeout settings for all the potential points (web server, sql server etc, the application itself). Just so you know, I have increased my connection string timeout setting by adding the following phrase:'connection timeout=0;' Lets hope some of lovelies can sort me out on this...its probably straightforward for someone who knows, but that ain't me! :-O Gah! Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
33 seconds? :omg: That is well over the acceptable response time for a "normal" web application to render. IIRC, the expected response time from your average user is 5 seconds or less. They tend to get annoyed and/or leave your site if things are taking longer. IMHO, unless this query is used in an application aimed at an exclusive set of well trained users... then you should be more concerned with tuning the query than increasing the time-out. --Jesse
-
Hello everybody-peeps. I have a ghastly problem that I need some help with. I have a stored procedure executing on SQL Server that is serving data to an asp.net webpage. Everything works fine until I try to execute a stored procedure that takes approximately 33 seconds to run. How on earth can I increase the timeout settings for all the potential points (web server, sql server etc, the application itself). Just so you know, I have increased my connection string timeout setting by adding the following phrase:'connection timeout=0;' Lets hope some of lovelies can sort me out on this...its probably straightforward for someone who knows, but that ain't me! :-O Gah! Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
Many thanks for your replies everyone. The winning solution is indeed the SqlCommand.CommandTimeout property - changing this allows you to handle those pesky longer running SPs. Its simple when you know it, as usual, but when you don't, its an exercise in banging your head. By word of warning, this has been tricky to identify at first, as the app in question happens to use the Microsoft.ApplicationBlocks.Data, in particular, the SqlHelper class which shields you from a lot of the ADO.NET classes that you may traditionally use. AFAIK ,when you use the SqlHelper class, you are shielded from the instantiation of the SqlCommand class. I don't really need to defend my long running SP (you know I am going to, with an opening phrase like that!), but suffice to say its for a particularly complex management report with a small user set, that rolls up and process a lot of data, and it has been optimised by the relevant DBA. 33 seconds - pretty fierce eh (mild embarassment: :-O)? All in all, I am very grateful for all your prompt responses and advice. Codeproject wins again, yay!:rose: Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
-
hi, a) stored procedure is bad written, try write it better/faster b) increase ASP.NET timeout in web.config MSDN reference[^] should help bt let me know if not best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)
Thanks for your help with this, the link is very useful, but in this case, it has not solved my problem. I have posted a reply with my eventual solution, and am grateful for you advice. Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
-
The timeout of the connection probably isn't the problem. That is just how long .NET will wait for a connection to be established with the database server. What you probably needs is the to set the
SqlCommand.CommandTimeout
. The default timeout is 30 seconds. Does this help?
Do you want to know more? WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
Top job, you hit the nail square on the head. Thanks alot. Please see my other post for "warning" about Microsoft.ApplicationBlocks.Data. I am not an expert user of this library, so I may be talking rot - perhaps there is a config file that goes with it allowing you to play with such settings.... Thansk again. Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
-
33 seconds? :omg: That is well over the acceptable response time for a "normal" web application to render. IIRC, the expected response time from your average user is 5 seconds or less. They tend to get annoyed and/or leave your site if things are taking longer. IMHO, unless this query is used in an application aimed at an exclusive set of well trained users... then you should be more concerned with tuning the query than increasing the time-out. --Jesse
Thanks Jesse, you are of course correct! Happily, I have beaten my user group into submission...heh heh, not so sure about them being well trained though. Profox Jase Co-Author, "Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET" (Apress, 2004, ISBN: 1-59059-330-8) The Book
-
33 seconds? :omg: That is well over the acceptable response time for a "normal" web application to render. IIRC, the expected response time from your average user is 5 seconds or less. They tend to get annoyed and/or leave your site if things are taking longer. IMHO, unless this query is used in an application aimed at an exclusive set of well trained users... then you should be more concerned with tuning the query than increasing the time-out. --Jesse
Jesse Squire wrote: That is well over the acceptable response time for a "normal" web application to render It depends on the application. Often an application that does flight or hotel reservations will have you sitting on a wait screen for half a minute or more while the database query gets a number of choices for you.
Do you want to know more? WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
-
Jesse Squire wrote: That is well over the acceptable response time for a "normal" web application to render It depends on the application. Often an application that does flight or hotel reservations will have you sitting on a wait screen for half a minute or more while the database query gets a number of choices for you.
Do you want to know more? WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
Fair point. The more I think about it, the more examples occur to me that disprove my original statement. :-O --Jesse