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 ...
随机推荐
- HBase(一)——HBase介绍
HBase介绍 1.关系型数据库与非关系型数据库 (1)关系型数据库 关系型数据库最典型的数据机构是表,由二维表及其之间的联系所组成的一个数据组织 优点: 1.易于维护:都是使用表结构,格 ...
- Listview使用
ListView控件比前面几种控件要复杂一些,通过此控件,可将项目组成带有或不带有列标头的列,并显示伴随的图标和文本.ListView控件是由ColumnHeader和ListItem对象所组成的,其 ...
- 关于 const char *ptr,char const *ptr,char *const ptr 的讨论
对于每个做C/C++的伙伴来说,面试中少不了关于const 的考察,尤其是对于刚毕业的新人. 今天听见同事在讨论这个问题,就随手写一下自己的理解.希望对大家又所帮助. 首先来说一下char *ptr: ...
- java 类记载器
转载: https://blog.csdn.net/javazejian/article/details/73413292
- python 获取系统环境变量 os.environ and os.putenv
从一段code说起 “if "BATCH_CONFIG_INI" in os.environ:” 判断环境变量的值有没有定义 如果定义的话就去环境变量的值,否则就取当前目录下的co ...
- Linux架构--------Rsync守护进程推和拉
一.Rsync基本概述 rsync是一款开源.快速.多功能.可实现全量及增量的本地或远程数据同步备份的优秀工具.rsync软件适用于Unix/linux/Windows等多种操作系统平台. 二.Rsy ...
- FAT12
FAT12 is one of FAT file system families,mostly used on 1.44MB floppy disk. FAT 's full name is File ...
- Python---面向对象编程---自定义列表和集合操作类
一.定义一个列表的操作类Listinfo 包括的方法 1.列表元素添加:add_key() 添加的必须是数字或者是字符串 2.列表元素取值:get_key() 3.列表合并:update_list( ...
- Linux学习-LVS跨网段DR模型和FWM多服务绑定
一.实验环境 系统:CentOS7.6 主机:5台 (虚拟机) 客户端1台:172.16.236.134/24 (NAT网卡),网关指向 172.16.236.185/24(路由服务器) 路由服务器1 ...
- 安装VS2017
www.visualstudio.com/zh-hans/downloads/ https://visualstudio.microsoft.com/zh-hans/thank-you-downloa ...