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 ?的更多相关文章

  1. 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 ...

  2. ASP.NET Application Life Cycle

    The table in this topic details the steps performed while an XAF ASP.NET application is running. Not ...

  3. 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 ...

  4. 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 ...

  5. ASP.NET Application,Session,Cookie和ViewState等对象用法和区别 (转)

    在ASP.NET中,有很多种保存信息的内置对象,如:Application,Session,Cookie,ViewState和Cache等.下面分别介绍它们的用法和区别. 方法 信息量大小 作用域和保 ...

  6. Custom ASP.NET Application into SharePoint --整合ASP.NET应用程序到SharePoint

    转:http://www.devexpertise.com/2009/02/18/integrating-a-custom-aspnet-application-into-sharepoint-par ...

  7. [转]ASP.net Application 生命周期事件

    生命周期事件和 Global.asax 文件 在应用程序的生命周期期间,应用程序会引发可处理的事件并调用可重写的特定方法.若要处理应用程序事件或方法,可以在应用程序根目录中创建一个名为 Global. ...

  8. php仿照asp实现application缓存的代码分享

    php 怎么没有asp 那样的application缓存呢?最近我找了很多,都只有自己写,下面我分享一段代码 class php_cache{ //相对或者绝对目录,末尾不要加 '/' var $ca ...

  9. Capturing ASP.NET Application Startup Exceptions

    It has become common practice to perform tasks during an ASP.NET applications start up process. Thes ...

随机推荐

  1. Codeforces 916 二进制1数目构造(阅读理解) 最小生成树1-N路径质数构造

    A #include <bits/stdc++.h> #define PI acos(-1.0) #define mem(a,b) memset((a),b,sizeof(a)) #def ...

  2. svn 命令行使用总结

    1.上传项目到SVN服务器上 svn import project_dir(本地项目全路径) http://192.168.1.242:8080/svn/IOS/Ben/remote_dir(svn项 ...

  3. Azure IoT 技术研究系列2

    上篇博文中,我们主要介绍了Azure IoT Hub的基本概念.架构.特性: Azure IoT 技术研究系列1-入门篇 本文中,我们继续深入研究,做一个起步示例程序:模拟设备注册到Azure IoT ...

  4. CobaltStrike + Metasploit 联动使用

    本节的知识摘要: 通过 beacon内置的 socks功能将本地 Msf直接代入目标内网 借助 CobaltStrike的外部 tcp监听器通过 ssh隧道直接派生一个 meterpreter到本地 ...

  5. vueroute的router.addRoutes

    router.addRoutes(routes: Array<RouteConfig>)动态添加更多路由到路由器.参数必须是使用与routes构造函数选项相同的路径配置格式的Array .

  6. 6411. 【NOIP2019模拟11.06】上网

    题目描述 Description Input Output 若无解,则输出"Impossible". 否则第一行输出"Possible",第二行输出 n 个正整 ...

  7. Bugku 杂项 telnet

    letnet 下载zip后发现是一个数据包,放到wireshark中打开 右键追踪tcp流后可以发现flag

  8. 颜色空间模型 与 Opencv中的HSV模型范围

    颜色空间总结 RGB.HSV.YUV 什么是颜色 Wiki是这样说的:颜色或色彩是通过眼.脑和我们的生活经验所产生的一种对光的视觉效应.嗯,简单点说,颜色就是人对光的一种感觉,由大脑产生的一种感觉.感 ...

  9. 【HDOJ6731】Angle Beats(极角排序)

    题意:二维平面上给定n个整点,q个询问 每个询问给定另外的一个整点,问其能与n个整点中任意取2个组成的直角三角形的个数 保证所有点位置不同 n<=2e3,q<=2e3,abs(x[i],y ...

  10. es之过滤器

    我们已经介绍了如何使用不同的条件查询来构建查询并搜索数据.我们还熟知了评分,它告诉我们在给定的查询中,哪些文档更重要以及查询文本如何影响排序.然而,有时我们可能要在不影响最后分数的情况下,选择索引中的 ...