简体   繁体   English

IIS应用程序池中禁用工作进程回收的影响

[英]impact of disabling recycling of worker process in IIS application pool

I have a WCF service hosted in IIS which takes a long time (around 5 hours) to execute. 我在IIS中托管了WCF服务,该服务需要很长时间(大约5个小时)才能执行。 the WCF service basically generates some reports using SSRS (SQL server reporting services) and saves them to a locaton on the server. WCF服务基本上使用SSRS(SQL服务器报告服务)生成一些报告,并将其保存到服务器上的某个位置。 this service was actually stopping after generating few reports, so I disabled the "recycling of worker process", "shut down worker processes after being idle" and "limit kernel request queue" in application pool and that fixed the issue and all the reports were generated regardless of the amount taken to generate them. 该服务实际上在生成少量报告后就停止了,因此我在应用程序池中禁用了“回收工作进程”,“在空闲后关闭工作进程”和“限制内核请求队列”,从而解决了该问题,所有报告无论生成它们所花费的数量如何。 but I am not sure if this is the right fix for this and I would like to know what is the impact of unchecking these settings in application pool for the WCF service in IIS? 但是我不确定这是否是正确的解决方法,并且我想知道取消选中IIS中WCF服务的应用程序池中的这些设置会产生什么影响? and is there any better way to get around this problem? 有没有更好的方法来解决此问题?

For any long running process it is much better to do it outside of IIS. 对于任何长时间运行的过程,最好在IIS之外进行。

In this case I would have a regular windows service running that monitored a request queue. 在这种情况下,我将运行一个常规的Windows服务来监视请求队列。 When a request comes in to generate a report, it would then spin off a thread to perform the generation. 当请求进入生成报告时,它将剥离一个线程来执行生成。

The web service would be responsible for 3 things. Web服务将负责三件事。 First, adding an item to the queue to be handled. 首先,将项目添加到要处理的队列中。 Second, checking status on the queue as to whether the report is ready. 其次,检查队列中有关报告是否准备就绪的状态。 Third, sending the completed report back to the calling client. 第三,将完成的报告发送回主叫客户端。

This would allow the client to essentially do a fire and forget on the report request and call back later to check on it's status. 这样一来,客户实际上就可以开火并忘记报告请求,稍后再回拨以检查其状态。 Further it would mean that if IIS recycled for whatever reason you are still OK. 此外,这意味着如果IIS由于任何原因进行了回收,那么您仍然可以。

For bonus points I would add some error handling code that when the windows service restarted it could restart report jobs that were in the middle of execution. 为了获得加分,我将添加一些错误处理代码,以便在Windows服务重新启动时可以重新启动执行过程中的报表作业。 This would make it a bit more robust and allow you to reboot the server at any point. 这会使它更健壮,并允许您随时重新启动服务器。

I have disable also all the automatic shut down process from iis for my application with out any issue. 我也为我的应用程序禁用了所有来自iis的自动关闭过程,没有任何问题。 I have monitor the memory limits and of course the program work smoothly with out any issues on memory. 我已经监视了内存限制,并且程序当然可以顺利运行,而不会出现任何内存问题。

I think that this automatic shut down triggers are designed mostly for process that keep too many web sites together and possible some of them have not good programming. 我认为这种自动关闭触发器主要是为将太多网站保持在一起的过程而设计的,其中一些可能没有很好的编程能力。 But if you are the master of your iis, and you have check your program that have not memory issue, then is better to not shut it down, or at least control the shut down process with some way. 但是,如果您是iis的主人,并且已经检查了没有内存问题的程序,那么最好不要关闭它,或者至少以某种方式控制关闭过程。

Ok is better to make long running process outside IIS, but is not so simple to develop it, not so simple to install it, not so simple to check it out. 确定最好在IIS之外进行长时间运行的进程,但是要开发它不是那么简单,安装起来不是那么简单,检出它也不是那么容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序池回收对辅助进程和WebEventProvider的影响 - Effects of Application pool recycling on worker process and WebEventProvider 当工作进程无响应时,如何防止IIS回收应用程序池 - How to prevent IIS from recycling Application Pool when a worker process is unresponsive IIS 工作进程 - 应用程序池 Memory 问题 - IIS Worker Process - Application Pool Memory Issues 限制IIS中每个工作进程的应用程序域数量(并禁用应用程序域的重复回收) - Limiting number of app domains per worker process in IIS (And disabling overlapped recycling of app domains) 检测IIS工作进程是否死锁并回收应用程序池 - Detect that a IIS Worker Process is deadlocked and recycle the Application Pool IIS 7工作进程瓶颈,大量等待应用程序池ASP.NET 3.5 + 2.0下的请求 - IIS 7 worker process bottleneck, large number of awaiting requests under application pool ASP.NET 3.5 + 2.0 Appfabric缓存和应用程序池回收 - Appfabric caching and recycling of application pool IIS应用程序池过程使用大量内存 - IIS Application Pool Process Using A lot of Memory IIS 8应用程序池回收问题-Sitefinity - IIS 8 App Pool recycling issues - Sitefinity 应用程序池vs应用程序域vs工作进程 - application pool vs application domain vs worker process
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM