繁体   English   中英

puma:服务器重新加载更快?

[英]puma: faster server reload?

我正在将Puma用于Rails应用程序,并且需要加快进行文件更改并使Web服务器能够重新加载页面的迭代循环。 现在至少需要30秒,这太慢了。 理想情况下,只需几秒钟。

如果有帮助,这是启动服务器的输出:

[26861] Puma starting in cluster mode...
[26861] * Version 2.8.2 (ruby 2.0.0-p451)
[26861] * Min threads: 4, max threads: 8
[26861] * Environment: development
[26861] * Process workers: 1
[26861] * Preloading application
[SKYLIGHT] [0.3.12] Running Skylight in development mode. No data will be reported until you deploy your app.
Deprecated, please require 'sidekiq/pro/web' now at /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.18/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
[26861] * Listening on tcp://0.0.0.0:4000
[26861] Use Ctrl-C to stop
[26939] + Gemfile in context: ~/project/Gemfile
2014-05-14T00:18:16Z 26939 TID-owgxfytuc INFO: Sidekiq Pro client with redis options {:url=>"redis://localhost:6001”, :driver=>:hiredis}
[26861] - Worker 0 (pid: 26939) booted, phase: 0

您应该能够在Rails应用程序中进行更改,而不必在开发模式下重新启动服务器(这是我认为的前提)。 有一些例外情况,例如初始化程序和迁移需要完全重新启动,但大多数情况下,您应该能够避免重新启动服务器。

但是,还有一些应用程序预加载器可以通过监视文件更改并加载服务器来加快服务器启动时间。

从rails 4.1开始,它已通过spring https://github.com/rails/spring集成到框架中,该框架支持rails 3.2向上。

我使用的另一个预加载器是Zeus,效果很好https://github.com/burke/zeus

那不是完整的预加载器列表,只是我实际使用的预加载器列表

希望能有所帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM