4

我知道有很多类似的问题,但我无法从这些问题中找到解决方案。所以我们开始吧.. 我在索尼 vaio 上使用 Ubuntu 12.04。我正在使用 Ruby1.9.3-p194 运行 Rails 3.2.8。我正在使用瘦服务器而不是 webbrick。我也运行着 mongoid、elasticseaerch 和 redis。

本地主机上的页面加载时间非常长(超过 10 分钟)。我知道这个应用程序并不慢,因为它在我同事的 macbook 上运行得很好。我不确定是什么导致它的加载时间非常长。

任何提示表示赞赏。我真的很伤心/不开心,因为它在工作中大大减慢了我的速度。我问过我的同事,但他们似乎都不知道答案。

该应用程序在公司的生产机器上运行良好。这似乎是我的笔记本电脑上的问题。请记住,我有一台速度非常快的笔记本电脑(i5、6gb RAM)

4

2 回答 2

0

Look at your logs. Use tail -f on the console to watch various logs. In your rails app, look at tail -f log/development.log You'll also want to look at your thin server logs. Since your coworkers are running the same codebase, it's probably not any of the actual code in rails taking that long. So your first step is to determine at which point in the http request is your app getting stuck for 10 minutes.

Also, make sure you have the same db as your colleagues. Eliminate as many variables as possible and start with your knowns.

Questions I'd ask myself:

  • Is the request reaching rails immediately?
  • Is another component (redis, mongodb) causing the problem due to your local config?

That said, a 10 minutes request that actually completes is bizarre - are you overriding timeouts?

于 2012-10-31T20:28:58.597 回答
0

Rails 使用了多少内存和 CPU?有多少内存和 CPU 可用?Rails 应用程序货车有时会泄漏内存并爬行停止。

于 2012-10-31T21:37:31.143 回答