Ingress Nginx 抛出客户端请求正文缓冲到临时文件警告

Ingress Nginx throwing a client request body is buffered to a temporary file warning

我们在两个 k8s 集群 A 和 B 上设置了入口资源主机名 xyz.int.com。使用的入口控制器是 nginx。在 DNS 上,我们设置 xyz.int.com 以指向各个集群中的负载均衡器 IP。

出于某种奇怪的原因,在一个集群中,我收到以下警告,并且无论成功与否,我都没有收到任何请求状态代码:

2022/01/17 17:58:00 [warn] 13239#13239: *94097411 a client request body is buffered to a temporary file /tmp/client-body/0001505726, client: 10.9.8.0, server: xyz.int.com, request: "POST /api/vss0/an/log/83f740daa89b3d3638b37a6a06de49a59f1f5126129a9a6?clientTimeInMs=1642442284833&sdkV=811409&gpid=a15e3b7c2-e1366-4327d-83a93-f7619&devNet=WIFI&locale=en-IN&region=IN HTTP/1.1", host: "xyz.int.com"

而另一个集群中的相同端点工作正常,并且 nginx 控制器或入口资源没有明显差异。

可能是什么问题?请协助。

总结评论:

此警告消息表示上传文件的大小大于为上传保留的 in-memory 缓冲区。

请参考this description解释client_body_buffer_size的工作原理:

Sets buffer size for reading client request body. In case the request body is larger than the buffer, the whole body or only its part is written to a temporary file. By default, buffer size is equal to two memory pages. This is 8K on x86, other 32-bit platforms, and x86-64. It is usually 16K on other 64-bit platforms.