Nginx是否还会缓冲来自客户端的http请求?

编程入门 行业动态 更新时间:2024-10-24 10:17:52
本文介绍了Nginx是否还会缓冲来自客户端的http请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道Nginx可以缓冲来自上游服务器的响应.

I know Nginx could buffer response from upstream server.

我的问题是,Nginx是否还会缓冲来自客户端的http请求?我的意思是,如果Nginx从客户端收到http请求,它是否立即与上游服务器建立连接?还是会在收到整个http请求后创建连接?

My question is, does Nginx also buffer http request from client? I mean, if Nginx get a http request from client, does it create connection with upstream server immediatly? Or it will create connection after it get a whole http request?

许多应用服务器框架都使用工作线程池模型.如果客户端计算机速度较慢或远离Nginx和上游服务器,而没有在Nginx端缓冲http请求,则上游服务器将在等待完成http请求时浪费大量CPU资源.

Many frameworks of application server use worker-thread-pool model. If the client machine is slow or far from Nginx and upstream server , without buffering http request in Nginx side, upstream server will waste pretty much CPU resource on waiting for completing a http request.

谢谢

推荐答案

以下是代理模块Wiki页面中的报价:

请注意,在使用HTTP代理模块时(甚至在使用FastCGI时),整个客户端请求将在传递给后端代理服务器之前在nginx中进行缓冲.

Note that when using the HTTP Proxy Module (or even when using FastCGI), the entire client request will be buffered in nginx before being passed on to the backend proxied servers.

此外,在nginx 1.7之前,无法禁用请求缓冲(请参见#251 ).

Moreover before nginx 1.7 it wasn't possible to disable request buffering (see #251).

更多推荐

Nginx是否还会缓冲来自客户端的http请求?

本文发布于:2023-11-06 01:28:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:还会   客户端   Nginx   http

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!