我一直在尝试通过其批量转换服务让容器化机器学习模型在 AWS sagemaker 上运行,该服务将整个数据集分解为更小的数据集,以便从机器学习模型中进行推理。
该容器有一个 Flask 服务,它在后台运行带有 Gunicorn 和 nginx 的 ML 模型。在执行批量转换时,我收到 502 bad gateway 错误,日志上出现以下错误(当我运行具有 50k 数据集作为输入的同一容器时,它通过 c5.xlarge 实例传递,但当我在 80k 以下的相同情况下运行时失败)
*4 upstream prematurely closed connection while reading response header from
upstream, client: IP, server: , request: "POST /invocations
HTTP/1.1", upstream: "http://unix:/tmp/gunicorn.sock:/invocations", host:
"IP:8080"
"POST /invocations HTTP/1.1" 502 182 "-" "Apache-HttpClient/4.5.x (Java/1.8.0_172)"
Run Code Online (Sandbox Code Playgroud)
Nginx 配置
worker_processes 1;
daemon off; # Prevent forking
pid /tmp/nginx.pid;
error_log /var/log/nginx/error.log;
events { defaults }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined; …Run Code Online (Sandbox Code Playgroud) 我正在编写一个完全在 AWS Athena 和 Python 上编写的巨大大数据 ETL 管道,只是编排 athena 查询,没有可以帮助模拟 AWS Athena 等的单元测试框架或库。我想编写单元测试并确保我的查询按预期工作。