Python web hosting: Why are server restarts necessary?

前端 未结 3 947
南旧
南旧 2021-01-05 14:38

We currently run a small shared hosting service for a couple of hundred small PHP sites on our servers. We\'d like to offer Python support too, but from our initial researc

3条回答
  •  长情又很酷
    2021-01-05 15:17

    Python is a compiled language; the compiled byte code is cached by the Python process for later use, to improve performance. PHP, by default, is interpreted. It's a tradeoff between usability and speed.

    If you're using a standard WSGI module, such as Apache's mod_wsgi, then you don't have to restart the server -- just touch the .wsgi file and the code will be reloaded. If you're using some weird server which doesn't support WSGI, you're sort of on your own usability-wise.

提交回复
热议问题