当它很慢时重启asp.net web应用程序 [英] restart asp.net web application when it is slow

查看:80
本文介绍了当它很慢时重启asp.net web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程方式重新启动Asp.net Web应用程序,因为处理状态(超过一分钟)处于非常缓慢的状态......?这样做的传统方式是稍微编辑web.config(空格,逗号,fullstop就可以了)...但是现在我想以编程方式...帮我朋友...这是我的web配置代码... < br $> b $ b



Is it possible to restart Asp.net web application programmatically when it will became very slow processing state (more than one min) state...? A traditional way of doing so is to edit the web.config slightly (a space, comma, fullstop would do the trick) … but now i want programmatically...help me friends...This my web config code...


<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<appSettings>
		<add key="Productivity" value="Data Source=xxxxx; Initial Catalog=Transcription WorkFlow; uid=xxxxx;pwd=xxxxxx;Connect Timeout=45"/>		
	</appSettings>
	<connectionStrings>
		<add name="ApplicationServices" connectionString="Data Source=xxxxx; Initial Catalog=Transcription WorkFlow; uid=xxxxx;pwd=xxxxx"/>
	</connectionStrings>
	<system.web>
		<customErrors mode="Off"/>
		<httpRuntime appRequestQueueLimit="50" executionTimeout="300"/>
		<httpHandlers>
      <add verb="*" path="*js.axd" type="ScriptCompressorHandler" />			
		</httpHandlers>
    <httpModules>
      <add name="RequestReduce"  type="RequestReduce.Module.RequestReduceModule, RequestReduce" />
      <add type="ScriptCompressorModule" name="ScriptCompressorModule" />
    </httpModules>		
		<compilation debug="false">
			<assemblies>
				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data.Services.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
		</compilation>
		<trace pageOutput="false" requestLimit="10" enabled="false" localOnly="true" traceMode="SortByTime" mostRecent="true"/>
		<authentication mode="Windows"/>
		<membership>
			<providers>
				<clear/>
				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="Productivity Diary"/>
			</providers>
		</membership>
		<profile enabled="true" automaticSaveEnabled="false">
			<providers>
				<clear/>
				<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="Productivity Diary"/>
			</providers>
		</profile>
		<roleManager enabled="true" cacheRolesInCookie="true">
			<providers>
				<clear/>
				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="Productivity Diary"/>
				<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="Productivity Diary"/>
			</providers>
		</roleManager>
	</system.web>
	<runtime>
		<generatePublisherEvidence enabled="false"/>
	</runtime>
	<system.web.extensions>
		<scripting>
			<scriptResourceHandler enableCompression="true" enableCaching="true"/>
		</scripting>
	</system.web.extensions>
	<system.webServer>
    <httpCompression>
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
      <dynamicTypes>
        <add mimeType="text/*" enabled="true"/>
        <add mimeType="message/*" enabled="true"/>
        <add mimeType="application/javascript" enabled="true"/>
        <add mimeType="*/*" enabled="false"/>
      </dynamicTypes>
      <staticTypes>
        <add mimeType="text/*" enabled="true"/>
        <add mimeType="message/*" enabled="true"/>
        <add mimeType="application/javascript" enabled="true"/>
        <add mimeType="*/*" enabled="false"/>
      </staticTypes>
    </httpCompression>
    <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
    <modules>
      <add name="RequestReduce" type="RequestReduce.Module.RequestReduceModule, RequestReduce" />
    </modules>
		<!--<modules runAllManagedModulesForAllRequests="false"/>-->
		<validation validateIntegratedModeConfiguration="false"/>		
	</system.webServer>
</configuration>

推荐答案

您应该找到网站变慢的原因。通过发现&确定你可以摆脱这些问题。查看此帖子了解原因。


ASP.NET性能:Web应用程序定期缓慢 - IIS重新循环 [ ^ ]



无论如何,请查看这篇文章

Stop/Start IIS .NET网站(C#) [ ^ ]



编辑

-------------------

这里很多,挖掘那些

我的网站太慢......我不知道该怎么做! [ ^ ]

ASP.NET网站上的常见性能问题 [ ^ ]
You should find the reason why the website getting slow. By find & fixing that you could get rid of these issues. Check this post for sample reasons.

ASP.NET Performance: Web Application Gets Slow Periodically – IIS Recycles[^]

Anyway for your question, take a look at this article
Stop/Start IIS Website in .NET (C#)[^]

EDIT
-------------------
Here a lot, dig those
My Web Site is so slow… And I don't know what to do about it![^]
Common performance issues on ASP.NET web sites[^]


这篇关于当它很慢时重启asp.net web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆