5

I am trying to pull in data from an array into a view to form a chart. The array is stored in a database field and is very large. The array contains around 70k+ smaller arrays that look like this, [1234567890, 5]. Every time I try to render the data in a view it gets cut off. It never loads the full array so the page does not render. No errors are given. Any ideas of what may be causing this?

I am running Ruby 2.0.0-p195, Rails 3.2.13, Postgres 9.2

4

2 回答 2

1

这是一个非常奇怪的问题。可能是在获取和返回部分数据期间发生超时,具体取决于超时的位置。

我要检查的内容:

  • 内存使用情况如何?当我添加 ram 时结果会改善吗?
  • 它总是在同一点被切断吗?
  • 您是否批量获取数据(find_each)?尝试使用批量大小。
  • 请求本身可以改进吗?
  • 如果 rails 日志没问题,请尝试查看 nginx(或您使用的任何内容)

如果所有选项都失败,请尝试通过执行多个 ajax 调用来批量异步加载。

于 2013-06-24T14:23:59.380 回答
0

固定的。这不是数据限制或 Postgres 问题。这些 NGINX 配置文件夹存在权限问题:

client_body_temp

fastcgi_temp

proxy_temp

我在一个新位置创建了这些文件夹,并将 nginx 配置为指向它们。然后让我们的 nginx 用户访问这些文件夹,现在一切正常。

于 2013-12-04T15:11:35.633 回答