使用持久进程 Web 服务(例如 Ruby on Rails、Turbogears 等)在共享主机上节省 RAM

发布于 2024-09-15 20:47:11 字数 240 浏览 11 评论 0原文

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

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

例如,Turbogears 将有一个持久进程:“pasterserve production.ini”,如果一段时间没有任何活动,我希望将其杀死。

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

如何在共享主机上实现此目的?

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

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缘字诀 2024-09-22 20:47:11

您可以尝试使用 passenger。尽管它最初是用于 Rails 的,但我发现很多人成功部署了 django 与乘客。我认为它也适用于涡轮齿轮。祝你好运。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文