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 ...
随机推荐
- 019-openstack组件使用的默认端口号
一.OpenStack组件使用的默认端口号 openstack openstack service default ports port type keystone Identity service ...
- 1130. Infix Expression (25)
Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with pa ...
- AC电源品字插座和空开接线图
- vi set the tab width for python
Put your desired settings in the ~/.vimrc file -- See below for some guidelines and best practices. ...
- PHP培训教程 PHP里10个鲜为人知但却非常有用的函数
php里有非常丰富的内置函数,很多我们都用过,但仍有很多的函数我们大部分人都不熟悉,可它们却十分的有用.这篇文章里,兄弟连小编列举了一些鲜为人知但会让你眼睛一亮的PHP函数. levenshtein( ...
- ELK整合Filebeat监控nginx日志
ELK 日志分析 1. 为什么用到 ELK 一般我们需要进行日志分析场景:直接在日志文件中 grep. awk 就可以获得自己想要的信息.但在规模较大的场景中,此方法效率低下,面临问题包括日志量太大如 ...
- Leetcode 16. 3Sum Closest(指针搜索)
16. 3Sum Closest Medium 131696FavoriteShare Given an array nums of n integers and an integer target, ...
- 支持向量机(四)----序列最小最优化算法SMO
在支持向量机(二)和(三)中,我们均遗留了一个问题未解决,即如何求解原问题的对偶问题: 在支持向量机(二)中对偶问题为: 在支持向量机(三)中的对偶问题为: 对于上述两个对偶问题,我们在支持向量机(三 ...
- 小程序封装wx.request,以及调用
1.新建一个api目录,与pages同级 2.在api目录下新建一个api.js文件 3.编写代码 const host = 'http://test.test.cn' const wxRequest ...
- 基于vue模块化开发后台系统——构建项目
文章目录如下:项目效果预览地址项目开源代码基于vue模块化开发后台系统--准备工作基于vue模块化开发后台系统--构建项目基于vue模块化开发后台系统--权限控制 前言 在熟悉上一篇说到准备工具之后, ...