简体   繁体   中英

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

我有一个使用粘贴的wsgi服务器,由于某些未知的原因,它经常会崩溃,所以我想拥有一个应用程序,或者只是某个软件包可以帮助我解决这个问题,当它崩溃时会自动终止该进程并重新启动它。不客气。

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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