使用持久性流程Web服务(例如Ruby on Rails,Turbogears等)在共享主机上保存RAM

时间:2022-10-12 22:03:39

I use Turbogears on my shared hosting for one-off applications, but I don't need these applications active all the time.

我在我的共享主机上使用Turbogears进行一次性应用程序,但我不需要这些应用程序始终处于活动状态。

Is there a way to start the service when I request it, and then kill the process when it's idle?

有没有办法在我请求时启动服务,然后在它空闲时终止它?

For example, Turbogears will have a persistent process: "paster serve production.ini" that I would like killed if there hasn't been any activity for a while.

例如,Turbogears将有一个持久的过程:“paster serve production.ini”,如果一段时间没有任何活动,我想杀死它。

On the flipside, if the process is killed, I want it to start up again when someone attempts to access the port.

另一方面,如果进程被终止,我希望当有人试图访问该端口时它再次启动。

How can I accomplish this on shared hosting?

如何在共享主机上完成此操作?

1 个解决方案

#1


0  

You can try using passenger. Eventhough it is originally for rails, but I have found many people successfully deployed django with passenger. I think it will work with turbogears as well. Good luck.

你可以尝试使用乘客。虽然它最初是用于铁路,但我发现很多人成功地与乘客一起部署了django。我认为它也适用于turbogears。祝你好运。

#1


0  

You can try using passenger. Eventhough it is originally for rails, but I have found many people successfully deployed django with passenger. I think it will work with turbogears as well. Good luck.

你可以尝试使用乘客。虽然它最初是用于铁路,但我发现很多人成功地与乘客一起部署了django。我认为它也适用于turbogears。祝你好运。