使用持久进程 Web 服务(例如 Ruby on Rails、Turbogears 等)在共享主机上节省 RAM
我在共享主机上使用 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用 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.