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 ...
随机推荐
- vim比较文件
横向分割显示: $ vim -o filename1 filename2 纵向分割显示: $ vim -O filename1 filename2 ctl w w 切换文件
- python3-获取对象信息
当我们拿到一个对象的引用时,如何知道这个对象是什么类型.有哪些方法呢? 使用type() 首先,我们来判断对象类型,使用type()函数: 基本类型都可以用type()判断: >>> ...
- FCC 成都社区·前端周刊 第 8 期
01. 2018 前端开发者手册 这是一份 2018 前端开发手册,内容包括三个部分:前端工程实践.前端开发学习和前端开发工具. 详情:https://frontendmasters.com/book ...
- 【UOJ#400】暴力写挂
题目链接 题意 两棵树 , 求出下面式子的最大值. \[dep[u]+dep[v]-dep[LCA(u,v)]-dep'[LCA'(u,v)]\] Sol 边分治. 与第一棵树有关的信息比较多,所以对 ...
- 进程队列补充、socket实现服务器并发、线程完结
目录 1.队列补充 2.关于python并发与并行的补充 3.TCP服务端实现并发 4.GIL全局解释器锁 什么是保证线程安全呢? GIL与Lock 5.验证多线程的作用 对结论的验证: 6.死锁现象 ...
- 阿里重磅开源全球首个批流一体机器学习平台Alink,Blink功能已全部贡献至Flink
11月28日,Flink Forward Asia 2019 在北京国家会议中心召开,阿里在会上发布Flink 1.10版本功能前瞻,同时宣布基于Flink的机器学习算法平台Alink正式开源,这也是 ...
- 有了二叉查找树、平衡树(AVL)为啥还需要红黑树?
序言 二叉查找树的缺点 平衡二叉树 虽然平衡树解决了二叉查找树退化为近似链表的缺点,能够把查找时间控制在 O(logn),不过却不是最佳的,因为平衡树要求每个节点的左子树和右子树的高度差至多等于1,这 ...
- Codeforces 864E - Fire(dp)
原题连接:http://codeforces.com/problemset/problem/864/E 题意:一个人想从大火中带走一些东西.每次他只能带一个,耗时ti ,价值为pi, 当总时间超过di ...
- PHPExcel组件编程spl_autoload_register
E:\html\tproject\framework\modules\common\vendor\PHPExcel\Classes\PHPExcel.php <?php /** PHPExcel ...
- #1126-JSP HTTP状态码
JSP HTTP状态码 HTTP请求与HTTP响应的格式相近,都有着如下结构: 以状态行+CRLF(回车换行)开始零行或多行头模块+CRLF一个空行,比如CRLF可选的消息体比如文件,查询数据,查询输 ...