简体   繁体   English

Heroku - Python / Django R14 - 超出内存配额

[英]Heroku - Python / Django R14 - Memory quota exceeded

I am unable to delete model instances in the Django admin.我无法在 Django 管理中删除模型实例。 When I try I get an application error with the following logs:当我尝试时,我收到一个带有以下日志的应用程序错误:

2017-06-01T16:49:52.582763+00:00 app[web.1]: [2017-06-01 16:49:52 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:27)
2017-06-01T16:49:53.966027+00:00 app[web.1]: [2017-06-01 16:49:53 +0000] [54] [INFO] Booting worker with pid: 54
2017-06-01T16:50:12.048171+00:00 heroku[web.1]: Process running mem=642M(125.4%)
2017-06-01T16:50:12.048339+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-06-01T16:50:22.371199+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/admin/auth/user/" request_id=e850ec27-3452-4e05-9077-00107a6dbd08 fwd="69.250.203.83" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=http
2017-06-01T16:50:23.409859+00:00 app[web.1]: [2017-06-01 16:50:23 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:45)
2017-06-01T16:50:23.676154+00:00 app[web.1]: [2017-06-01 12:50:23 +0000] [45] [INFO] Worker exiting (pid: 45)
2017-06-01T16:50:24.927345+00:00 app[web.1]: [2017-06-01 16:50:24 +0000] [63] [INFO] Booting worker with pid: 63

This is my procfile:这是我的 procfile:

web: gunicorn djangoall.wsgi
worker: celery -A djangoall worker --autoscale=10,3
beat: celery -A djangoall beat -S django

Performing this action works fine in my local environment.在我的本地环境中执行此操作工作正常。 The Heroku documentation references memory errors are language specific and does not include a Python guide. Heroku 文档参考内存错误是特定于语言的,不包括 Python 指南。

I have looked at the number of SO questions but did not have success when I lowered workers by one (by changing --autoscale=10,3 to --autoscale=10,2) per this answer I am getting Error R14 (Memory quota exceeded) in heroku with a Django app .我已经查看了 SO 问题的数量,但是当我根据此答案将工作人员降低 1(通过将 --autoscale=10,3 更改为 --autoscale=10,2)时没有成功我收到错误 R14(内存配额)超过)在带有 Django 应用程序的 heroku 中

As you said in your question, you are trying to delete model instances from your app's admin panel.正如您在问题中所说,您正在尝试从应用程序的管理面板中删除模型实例。 Let's assume you achieve that with no memory-quota errors from Heroku, that would free up database storage space.假设您在 Heroku 没有内存配额错误的情况下实现了这一点,这将释放数据库存储空间。

The error you're getting has to do with your traffic.您遇到的错误与您的流量有关。 Try spinning up another web dyno, as this is running out of memory.尝试启动另一个 web dyno,因为它的内存不足。

heroku restart为我解决了这个问题。

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

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