简体   繁体   English

几次请求后IIS 7.5崩溃(使用Django + PyISAPIe)

[英]IIS 7.5 crashes after a few requests (with Django + PyISAPIe)

I managed to run Django using IIS as webserver (using PyISAPIe ) and everything goes well in my test server, mounting Windows 2008 Server R2 64bit. 我设法使用IIS作为网络服务器运行Django(使用PyISAPIe )并且我的测试服务器中的一切顺利,安装了Windows 2008 Server R2 64位。

Then I installed the application on another server with the same configuration and it works fine for the first request. 然后我在具有相同配置的另一台服务器上安装了该应用程序,它适用于第一个请求。 Then when I reload the page, I get a "Service not working" page. 然后当我重新加载页面时,我得到一个“服务不工作”页面。

On the event log I see an Application error saying that python26.dll had some problems: 在事件日志中,我看到一个应用程序错误,说python26.dll有一些问题:

Faulting application name: w3wp.exe
Faulting module name: python26.dll
Exception code: 0x40000015
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Windows\system32\python26.dll

Can you give me some hint on how to solve that problem? 你能给我一些如何解决这个问题的提示吗?

UPDATE : "Rapid-Fail Protection" in the Advanced Settings of the Application Pool was set to 5 failures; 更新 :应用程序池的高级设置中的“快速失败保护”设置为5次失败; disabling it, all worked well. 禁用它,一切运作良好。

So, now the question is: how can I detect what caused the failures? 那么,现在的问题是:如何检测导致故障的原因?

UPDATE : I discovered that IIS crashes when there are multiple requests (img, css, js). 更新 :我发现当有多个请求(img,css,js)时IIS崩溃。 PyISAPIe is called for each of them, passing them to static server once recognized. 为每个人调用PyISAPIe,一旦识别就将它们传递给静态服务器。 No idea why this happens... 不知道为什么会这样......

PyISAPIe不是在Windows 2008上运行Django的好选择。在本文中,您可以找到更好的解决方案: 在Windows上运行Django(带有性能测试)

I discovered that IIS crashes when there are multiple requests (img, css, js). 我发现当有多个请求(img,css,js)时IIS崩溃了。 PyISAPIe is called for each of them, passing them to static server once recognized. 为每个人调用PyISAPIe,一旦识别就将它们传递给静态服务器。 No idea why this happens... 不知道为什么会这样......

Do multiple request cause the error on both machines? 多个请求会导致两台机器上的错误吗? When there are multiple requests in an ISAPI application, each request runs in its own thread. 当ISAPI应用程序中有多个请求时,每个请求都在其自己的线程中运行。 The Python multi-threading model is GLOBAL - all threads running under that Python process are co-mingled and sharing all global resources, so you must serialize all multi-threaded code running in all applications and processes using your Python engine. Python多线程模型是GLOBAL - 在该Python进程下运行的所有线程都是混合在一起并共享所有全局资源,因此您必须使用Python引擎序列化在所有应用程序和进程中运行的所有多线程代码。 This is a serious downside in Python multi-threaded processing and may be the source of your problems. 这是Python多线程处理的一个严重缺点,可能是您的问题的根源。 See http://docs.python.org/library/multiprocessing.html and other sources. 请参阅http://docs.python.org/library/multiprocessing.html和其他来源。

But even this only occurs on one machine and not the other, that may still be the cause - it could also depend on many other environmental variables - number of requests, resources of the machine, processors, etc. 但即使这只发生在一台机器而不是另一台机器上,这可能仍然是原因 - 它还可能依赖于许多其他环境变量 - 请求数量,机器资源,处理器等。

Check the eventlog it should be in there. 检查它应该在那里的事件日志。

You may also find some more detail in the httperror log (C:\\Windows\\System32\\LogFiles\\HTTPERR). 您还可以在httperror日志中找到更多详细信息(C:\\ Windows \\ System32 \\ LogFiles \\ HTTPERR)。

检查机器上的内存使用情况(物理总量)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM