How to increase timeout for your ASP.NET Application ?
How to increase timeout for your ASP.NET Application ?
原文链接:https://www.techcartnow.com/increase-timeout-asp-net-application/
对于application主要有3种方式,对于sql主要有2种方式
A. executionTimeout attribute of httpRuntime element (web.config):
ASP.NET will timeout the request, if it is not completed within “executionTimeout” duration value. And System.Web.HttpException: Request timed out exception will be thrown by ASP.NET Application.
executionTimeout attribute of httpRuntime element (in the web.config) can be used to change the request timeout duration for ASP.NET Application. executionTimeout value is specified in seconds. Default value is 110 seconds.
1
2
3
4
5
|
<configuration>
<system.web>
<httpRuntime targetFramework="4.5.1" executionTimeout="500" />
</system.web>
</configuration>
|
B. timeout attribute of sessionState element (web.config):
If the user remains idle for duration specified in timeout attribute vaule of sessionState element (in web.config), then his session will expire.
timeout attribute of sessionState element (in the web.config) can be used to change session timeout duration for ASP.NET Application. timeout value is specified in minutes. Default value is 20 minutes.
1
2
3
4
5
|
<configuration>
<system.web>
<sessionState timeout="20"></sessionState>
</system.web>
</configuration>
|
C. Idle Time-out Settings for an Application Pool (IIS):
If the worker process remain idle for duration specified in Idle Time-out Settings for an Application Pool , then worker process will shut down.
Idle Time-out Settings for an Application Pool value is specified in minutes. The default value for Idle Time-out Settings for an Application Pool is 20 minutes.
D. SqlCommand.CommandTimeout (SQL SERVER):
ADO.NET will wait for duration specified in SqlCommand.CommandTimeout before cancelling the query.
1
2
3
4
5
6
7
8
|
using (var connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(queryString, connection);
// Setting command timeout to 100 second
command.CommandTimeout = 100;
command.ExecuteNonQuery();
}
|
SqlCommand.CommandTimeout value is specified in seconds. The default value of SqlCommand.CommandTimeout is 30 seconds.
E. SqlConnection.ConnectionTimeout:
If connection is not opened within the duration specified in SqlConnection.ConnectionTimeout, timeout exception will be thrown.
1
|
Data Source=(local);Initial Catalog=TechCartNow;Integrated Security=SSPI;Connection Timeout=30
|
SqlConnection.ConnectionTimeout value is specified in seconds. The default value of SqlCommand.CommandTimeout is 15 seconds.
How to increase timeout for your ASP.NET Application ?的更多相关文章
- Why does the memory usage increase when I redeploy a web application?
That is because your web application has a memory leak. A common issue are "PermGen" memor ...
- ASP.NET Application Life Cycle
The table in this topic details the steps performed while an XAF ASP.NET application is running. Not ...
- ASP.NET Application and Page Life Cycle
ASP.NET Application Life Cycle Overview for IIS 7.0 https://msdn.microsoft.com/en-us/library/bb47025 ...
- Debug your ASP.NET Application while Hosted on IIS
转摘:http://www.codeproject.com/Articles/37182/Debug-your-ASP-NET-Application-while-Hosted-on-IIS This ...
- ASP.NET Application,Session,Cookie和ViewState等对象用法和区别 (转)
在ASP.NET中,有很多种保存信息的内置对象,如:Application,Session,Cookie,ViewState和Cache等.下面分别介绍它们的用法和区别. 方法 信息量大小 作用域和保 ...
- Custom ASP.NET Application into SharePoint --整合ASP.NET应用程序到SharePoint
转:http://www.devexpertise.com/2009/02/18/integrating-a-custom-aspnet-application-into-sharepoint-par ...
- [转]ASP.net Application 生命周期事件
生命周期事件和 Global.asax 文件 在应用程序的生命周期期间,应用程序会引发可处理的事件并调用可重写的特定方法.若要处理应用程序事件或方法,可以在应用程序根目录中创建一个名为 Global. ...
- php仿照asp实现application缓存的代码分享
php 怎么没有asp 那样的application缓存呢?最近我找了很多,都只有自己写,下面我分享一段代码 class php_cache{ //相对或者绝对目录,末尾不要加 '/' var $ca ...
- Capturing ASP.NET Application Startup Exceptions
It has become common practice to perform tasks during an ASP.NET applications start up process. Thes ...
随机推荐
- PAT Advanced 1031 Hello World for U (20 分)
Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For ...
- VB中RaiseEvent语句的功能及用法
Creat a new class named Class1, it's codes like this: Public Event MyEvent() Public Sub RaiseTheEven ...
- 10年前文章_iscsi initiator 设置
发现和查找 target, iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 登录 iscsiadmin -m node -l 退出登录 ...
- Codeforces 矩阵题 题单
Matrix CF 166E Tetrahedron dp方程设为 f[i] 最后在 D点,g[i] 表示最后不在D点.最后 g[] 可以通过矩阵加速数列求得,数据可以强化,复杂度 \(O(logn) ...
- 基于VUE多人聊天项目
项目背景 公司平台要做一个通讯系统,本来是java 来做的后面改前端+PHP来做,所以就用VUE来做这个了. github github地址 新人求star 技术栈 vue-axios vuex we ...
- 字符编码、python2和python3编码的区别
目录 字符编码 文本编辑器存储信息的过程 python解释器解释python代码的流程 python解释器与文本编辑器的异同 不同编码格式存入与读取数据的过程 乱码的分析 python2和python ...
- mysql IN操作符 语法
mysql IN操作符 语法 作用:在 WHERE 子句中规定多个值.深圳大理石平台 语法:SELECT column_name(s) FROM table_name WHERE column_nam ...
- mysql DISTINCT语句 语法
mysql DISTINCT语句 语法 作用:用于返回唯一不同的值. 语法:SELECT DISTINCT 列名称 FROM 表名称.扬州大理石量具 mysql DISTINCT语句 示例 //从表中 ...
- H. The Game of Life
题目链接:http://exam.upc.edu.cn/problem.php?id=5206 题意:邻居为八个方向.若一个活人有2或3个邻居,遗传一代,否则死亡:若一个死人有3个邻居,则下一代复活. ...
- 转:SpringMVC常见面试题总结(超详细回答)
原文:https://blog.csdn.net/a745233700/article/details/80963758 我略微修改了下某些地方 1.什么是Spring MVC ?简单介绍下你对sp ...