【问题标题】:Uploading large files to AWS Elastic Beanstalk / nginx将大文件上传到 AWS Elastic Beanstalk / nginx
【发布时间】:2022-01-13 03:35:06
【问题描述】:

我有一个应用程序可以上传一个在 Heroku 和本地开发人员机器上运行良好的文件 - 但在 AWS EB 上,上传被中断并且没有完成。

我已将 nginx 指令设置如下

.ebextensions/00_project.config

files:
    "/etc/nginx/conf.d/proxy.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
            client_max_body_size 2000M
            client_body_buffer_size 2000M
option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: server:application

.platform/nginx/conf.d/proxy.conf

client_max_body_size 2000M;
client_body_buffer_size 2000M;

.platform/nginx/00_myconf.config

container_commands:
  01_reload_nginx:
    command: "service nginx reload"

这是运行 python3.8 并使用名为 Dash 的 plotly/react 框架。 https://dash.plotly.com/introduction

如前所述,它只是无法在 AWS 上运行,因此似乎是系统配置问题。为了确认这一点,我将一个大文件上传到一个公共存储桶,并让这个应用程序从存储桶中读取而不是上传,它运行良好。

我已经用尽了所有选项,因此非常感谢任何帮助!

【问题讨论】:

  • 上传被中断时,你得到什么错误代码?这将帮助您了解是 nginx 还是 python 问题。
  • 没有错误可言。至少我看不到......但是你的问题促使我检查我看到这个的beantalk日志。 12 月 8 日 05:58:47 ip-172-31-7-149 web: MemoryError
  • 并且该错误在 web.stdout.log 文件中。 nginx 日志看起来不错,但我确实看到了这个警告(不管它看起来多么无害) 2021/12/08 05:57:22 [warn] 3988#3988: *158 上游响应被缓冲到临时文件 /var/lib/ nginx/tmp/proxy/4/00/0000000004 读取上游,客户端:172.31.12.108,服务器:,请求:“GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1”,上游:“127.0.0.1:8000/_dash-component-suites/dash/dcc/…”,主机:“.removed.ap-southeast-2.elasticbeanstalk.com”,推荐人:“
  • 增加实例大小修复了它! kgiannakakis 如果您想回答“通过向 AWS 支付更多的钱来升级您的实例大小”,那么我会将其标记为正确。如果不是您的评论,我不会在日志中看到该错误。
  • 你写一个答案并接受它会更合适。回答你自己的问题很好。这可能会在未来对其他人有所帮助。

标签: python python-3.x amazon-web-services nginx amazon-elastic-beanstalk


【解决方案1】:

在得到kgiannakakis的提示后,我查看了日志,发现web.stdout.log文件中有“web: MemoryError”这一行。

所以我将 EB 实例升级到更大一些,它设法解决了这个问题......所以基本上我的内存用完了,需要向 AWS 支付更多的钱来获得更多的内存。

【讨论】:

    猜你喜欢
    • 2012-07-05
    • 2021-11-16
    • 2016-06-20
    • 2015-11-30
    • 2015-02-18
    • 2020-05-30
    • 2020-08-27
    • 2020-10-30
    • 2022-01-09
    相关资源
    最近更新 更多