问题
The site periodically becomes unavailable with HTTP 500 error. All I could find from the logs so far is:
ModuleName iisnode
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 1001
ErrorCode The system cannot find the file specified. (0x2)
Note that response time in this instance is around 38 seconds. I suspect this happens because IISNode process goes to sleep and the when it wakes up it fails on the first request after long time out. I created Azure WebJob that pings the site every 15 minutes to keep it alive and it seemed resolved the issue. I am just wondering if there's a better solution.
回答1:
There is a GitHub issue here that addresses this issue. The problem is due to the nature of how IIS lazily initializes the node process. Requests may be dropped if initialization takes too long. The suggested solution is to increase one or both of the values for maxNamedPipeConnectionRetry and namedPipeConnectionRetryDelay in your web.config
or iisnode.yml
file. The GitHub answer goes into more detail about why those values are relevant.
来源:https://stackoverflow.com/questions/27760975/iisnode-periodically-fails-with-http-500-1001-on-azure