【问题标题】:I am getting Error R14 (Memory quota exceeded) in heroku with a Django app我在使用 Django 应用程序的 heroku 中收到错误 R14(超出内存配额)
【发布时间】:2015-03-24 20:22:26
【问题描述】:

我在 Heroku 平台上为我的 Django 应用程序运行 3 个测功机。它工作正常(1.5 年)。自 2 周以来,我经常收到 Error R14 (Memory quota exceeded) 错误。

我应该怎么做才能避免这个错误?如何监控问题?

2015-01-27T10:34:01.855731+00:00 app[web.3]: Starting development server at http://0.0.0.0:43181/
2015-01-27T10:34:02.042166+00:00 heroku[web.3]: State changed from starting to up
2015-01-27T10:34:15.626327+00:00 heroku[web.2]: Error R14 (Memory quota exceeded)
2015-01-27T10:34:15.626241+00:00 heroku[web.2]: Process running mem=662M(129.4%)
2015-01-27T10:34:28.151622+00:00 heroku[router]: at=info method=GET path="/api/shop/651/?format=json&&account=(null)" request_id=2d904167-3a7d-4c8c-9b2c-ae845d0fffa9 fwd="88.247.106.124" dyno=web.1 connect=0ms service=3009ms status=200 bytes=282437
2015-01-27T10:34:28.146392+00:00 app[web.1]: [27/Jan/2015 12:34:28] "GET /api/shop/651/?format=json&&account=(null) HTTP/1.1" 200 282077
2015-01-27T10:34:35.480951+00:00 heroku[web.2]: Process running mem=662M(129.4%)
2015-01-27T10:34:35.481269+00:00 heroku[web.2]: Error R14 (Memory quota exceeded)
2015-01-27T10:34:55.511625+00:00 heroku[web.2]: Process running mem=662M(129.4%)
2015-01-27T10:34:55.511625+00:00 heroku[web.2]: Error R14 (Memory quota exceeded)

这些是日志。

还有孔雀鱼结果:

>>> hp.setref()
>>> hp.heap()
Partition of a set of 40 objects. Total size = 6632 bytes.
Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
 0      5  12     3160  48      3160  48 unicode
 1     25  62     2200  33      5360  81 __builtin__.weakref
 2      6  15      496   7      5856  88 list
 3      1   2      488   7      6344  96 types.FrameType
 4      2   5      184   3      6528  98 tuple
 5      1   2      104   2      6632 100 urlparse.SplitResult
>>> hp.heap()
Partition of a set of 24479 objects. Total size = 12695072 bytes.
 Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
 0   7212  29  7558176  60   7558176  60 dict of tastypie.fields.CharField
 1    265   1   866008   7   8424184  66 dict (no owner)
 2    232   1   777664   6   9201848  72 dict of 0x7fe18acb9360
 3    696   3   729408   6   9931256  78 dict of tastypie.fields.DecimalField
 4    567   2   594216   5  10525472  83 dict of tastypie.fields.BooleanField
 5    517   2   541816   4  11067288  87 dict of tastypie.fields.IntegerField
 6   7212  29   461568   4  11528856  91 tastypie.fields.CharField
 7    260   1   272480   2  11801336  93 dict of tastypie.fields.DateTimeField
 8   1255   5   223952   2  12025288  95 unicode
 9     53   0    96248   1  12121536  95 dict of tastypie.fields.ToManyField

【问题讨论】:

  • 这不是更好地询问heroku支持吗?
  • 投票结束,因为这个问题更适合 heroku 技术支持;特别是因为您还没有发现编程问题。我们不可能解决这个问题。
  • 这是对您的应用程序的有效请求吗? /api/shop/651/?format=json&&account=(null)?
  • 是的,这不是问题。

标签: django heroku


【解决方案1】:

在我的情况下,我在处理繁重的请求后遇到了错误,应用程序只需要一个 heroku restart 即可获得新的干净状态

根据文档heroku restart 制作一个全新的干净测功机 => Heroku CLI Commands

【讨论】:

    【解决方案2】:

    您可能存在内存泄漏,或者您的服务器正在运行太多并发进程。你在用独角兽吗?如果是这样,请查看您的 procfile 并查看您正在运行多少个工人 - 然后将其减少一个。

    要跟踪问题,请尝试运行:

    $ heroku logs --tail
    

    在命令行上查看您的网络日志并查看内存错误何时开始出现。

    【讨论】:

      猜你喜欢
      • 2017-11-02
      • 1970-01-01
      • 2017-04-16
      • 2013-10-01
      • 2020-11-23
      • 2023-03-28
      • 2014-07-14
      • 2012-02-11
      • 1970-01-01
      相关资源
      最近更新 更多