开发者

how to monitor python wsgi server,when it crashed restart it

开发者 https://www.devze.com 2023-01-20 11:58 出处:网络
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 automatic

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号