简体   繁体   English

如何加快Rails开发环境并避免分拆

[英]How to speed up Rails Development Environment and avoid spinning up

I have an application demo coming up soon and I need my development environment to be a bit faster than it currently is. 我即将发布一个应用程序演示,我需要我的开发环境要比现在快一些。 I'm running a Rails 3.2.19 app with Ruby 1.9.3, Postgres, and Anvil/Pow to serve on a Apple Mac Mini (Core i5/4g ram) and need to be able to demo the application with decent response times. 我正在运行带Ruby 1.9.3,Postgres和Anvil / Pow的Rails 3.2.19应用程序,以便在Apple Mac Mini(Core i5 / 4g ram)上运行,并且需要能够以适当的响应时间演示该应用程序。

In production, the app runs very fast but in development it's more sluggish and at times if I let the app sit idle and hit another URL it takes up to a minute for the app to spin up again. 在生产中,该应用程序运行非常快,但是在开发中,它速度较慢,有时,如果我让该应用程序处于空闲状态并点击另一个URL,则该应用程序可能需要一分钟才能重新启动。

I'm wondering if it's a problem with Pow and that I should instead just run a local rails s instance to spin up the environment. 我想知道Pow是否有问题,我应该只运行一个本地rails s实例来加速环境。 The main issue I'm seeing is that when the app sits idle for a while (let's say an hour or so) when I go to hit a url or resource within the app it can take up to a minute for the app to respond again. 我看到的主要问题是,当应用程序闲置一会儿(例如一个小时左右)时,当我点击应用程序中的网址或资源时,该应用程序可能需要一分钟才能再次响应。

Is there something I'm missing here that would allow me to prevent the latency? 我在这里缺少什么可以防止延迟的东西吗?

My personal opinion is to ditch Pow and go with Unicorn or Thin or Puma but for the love of all that's good do not use the built-in, default of WEBrick :)! 我个人的观点是抛弃Pow,选择UnicornThinPuma,但出于对所有优点的热爱,请不要使用内置的默认WEBrick :)!

I use Unicorn locally (it's also what we use on our production boxes) and my local sites are as fast or faster than production. 我在本地使用Unicorn(这也是我们在生产包装盒上使用的),而我在本地的站点比生产快或快。

I started out with Pow but ran into a lot little 'issues' like you've mentioned and have been happy since switching to run Unicorn as my Rails development server . 我从Pow开始,但是遇到了很多小问题,就像您提到的那样,自从切换到将Unicorn作为我的Rails开发服务器运行以来,我一直很高兴。

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

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