IIS 7.5 crashes after multiple requests (with Django + PyISAPIe)

I managed to start Django using IIS as a web server (using PyISAPIe ), and everything works fine on my test server, installing Windows 2008 Server R2 64bit.

Then I installed the application on another server with the same configuration and works fine for the first request. Then, when I reload the page, I get the page "Service is not working."

In the event log, I see an application error saying that python26.dll has some problems:

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 this problem?

UPDATE : "Faster crash protection" in the advanced settings of the application pool was set to 5 failures; turning it off, everything works well.

So now the question is: how can I detect what caused the errors?

UPDATE I found that IIS crashes when there are multiple requests (img, css, js). PyISAPIe is called for each of them, passing them to the static server after it is recognized. I don’t know why this is happening ...

+4
source share
4 answers

PyISAPIe is not a good choice to run Django on Windows 2008. In this article you can find the best solution: Running Django on Windows (with performance checks)

+2
source

Check the event log in which it should be.

You can also find more information in the httperror log (C: \ Windows \ System32 \ LogFiles \ HTTPERR).

+1
source

I found that IIS crashes when there are multiple requests (img, css, js). PyISAPIe is called for each of them, passing them to the static once recognized server. I don’t know why this is happening ...

Do many queries get an error on both machines? When there are multiple requests in an ISAPI application, each request is launched in its own thread. Python GLOBAL multithreading model - all threads executed within this Python process are combined and allocate all global resources, so you should serialize all multithreaded code executed in all applications and processes using your Python mechanism. This is a serious flaw in Python's multi-threaded processing and can be the source of your problems. See http://docs.python.org/library/multiprocessing.html and other sources.

But even this happens only on one machine, and not on another, which may be the reason - it can also depend on many other environment variables - the number of requests, machine resources, processors, etc.

+1
source

Check the memory usage on the computer (general physical).

0
source

Source: https://habr.com/ru/post/1348112/


All Articles