像PHP一样热部署Ruby:FTP上传文件并立即生效 [英] Hot deploy Ruby just like PHP: FTP upload file and valid immediately
问题描述
是否可以像PHP一样热部署Ruby?
通常我使用FTP上传PHP文件,然后它将自动可用。
Ruby可以如此热点部署其文件?
您的评论欢迎。
你在谈论rails应用程序中的ruby吗?
如果是这样,在生产模式下部署rails应用程序时,所有应用程序都将被加载记忆。所以更改文件不会影响正在运行的应用程序。
要重新启动rails应用程序,您需要使用以下解决方案:
彪马是第一次最简单的方法。
但是,如果您正在寻找零停机时间,请独角兽或乘客企业是您正在寻找的。 p>
< h1>编辑
独角兽
- 免费
- 复杂配置
- 在热重启时,零停机。当热启动独角兽时,它保持旧的线程工作,直到新的完整的功能。所以如果新的没有启动,没有任何反应。
美洲狮
- 免费
- 简单配置
- 热启动但没有零停机时间。当热重启美洲豹时,它关闭旧线程并启动新线程。 Puma保持套接字打开,所以客户端没有断开连接,但正在等待新线程重新启动时得到响应。但是如果新的线程无法启动,Puma将无法重启旧的线程。所以连接丢失,服务器关闭。
乘客
免费版本
- 免费
- 配置比独角兽更容易
- 热重启,但没有零停机。像Puma一样。
企业版
- $ 29 / mo
- 在热重启时,配置比独角兽更容易,
- 零停机。像独角兽。
Is it possible to hot deploy Ruby just like PHP? Normally I used FTP to upload the PHP file, then it will be available automatically. Can Ruby hot deploy its file like this?
Your comment welcome.
Are you talking about a ruby on rails application ?
If so, when deploying a rails application in production mode, the all application gets loaded in memory. So changing the files won't affect the running application.
For hot restarting a rails application you will need to use solution such as:
For a first time, Puma is the easiest way.
However if you are looking for a zero-downtime, either Unicorn or Passenger enterprise are what you are looking for.
EDIT
Unicorn
- Free
- Complex configuration
- zero-downtime when hot restarting. when hot-restarting unicorn, it keeps the old threads working until the new ones are fully functionnal. So if the new ones fail to start, nothing happens. The old ones just keep going.
Puma
- Free
- Simple configuration
- hot restart but no zero-downtime. When hot-restarting puma, it shuts down the old threads and starts the new ones. Puma keeps the sockets open, so the client are not disconnected, but are waiting to get a response while the new threads restart. However if the new threads fail to start, Puma can't restart the old ones. So connections are lost and the server is down.
Passenger
Free edition
- Free
- The configuration is easier than unicorn
- hot-restart, but no zero-downtime. Like Puma.
Enterprise edition
- $29/mo
- The configuration is easier than unicorn
- zero-downtime when hot restarting. Like Unicorn.
这篇关于像PHP一样热部署Ruby:FTP上传文件并立即生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!