how to monitor python wsgi server,when it crashed restart it
i have a wsgi server which use paste,for some unkonw reason,it will often crash,so i want to has 开发者_如何学JAVAa application or just some package can help me to slove this,when it crashed automaticly kill the process and restart it.Any advice is welcome.
I'd use your operational system's service integration to do that. For example, on debian linux, there's start-stop-daemon. On windows, there's the service management.
It's the proven, well integrated way, provided by the operational system itself, to keep an application running.
Just make your installation program register your service with the native service management system.
You can use supervisord to run your service. It provides auto-restart option in a program configuration. You can reference to the autorestart section in this document.
To know how to use it with Python, you can reference to my answer on this topic.
精彩评论