In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
As the name implies, proxy_buffer is a buffering feature for proxy mode. This paper introduces its basic usage.
What is buffer?
Buffer, that is, the buffer, its role on the Nginx is to enable a buffer in which the data is stored and then sent. Similar to watching video online, buffering a portion of the video file locally before playing it.
Without buffer, data will be transferred directly from Nginx to the client. Suppose that if the client loads fast enough, you can just turn off buffer and let the data reach the client as quickly as possible.
Using buffer,Nginx will temporarily store the back-end response into the buffer, and then slowly send the data to the client. The advantage of enabling buffer is that data can be sent to the destination at once, saving this part of the bandwidth compared to instant transmission.
Incidentally, the role of tcp_nopush in the global configuration of Nginx is that packets are not sent until they are accumulated to a certain size. Tcp_nodelay sends data as soon as possible, so if you enable buffer, it is recommended to turn off tcp_nodelay.
Here is a summary of the nginx buffer settings:
Proxy_buffer_size 4k proxies buffering on;proxy_buffers 4 4k proxies buses buffers buffers size 8kth proxy maxillofacial buffering filesize 1024m
First of all, these parameters are for each http request, not global.
Configuration of proxy_buffer
Proxy_buffer is a buffer configuration for proxy mode (commonly referred to as a reverse proxy). Nginx has another buffer configuration for server mode, which is not covered in this post.
Proxy_buffer includes the following configuration items:
Note that the values specified below are for the upper limit for each http request, not for the entire buffer zone.
Proxy_buffering
Proxy_buffering on
Proxy_buffers and proxy_busy_buffers_size only work when proxy_buffering is turned on.
Proxy_buffers
Proxy_buffers 4 8k
Specify the number and size of buffer for an request.
Proxy_buffer_size
Proxy_buffer_size 4k
Specifies the size of the buffer of the backend response. It is part of the back-end response, which contains Headers, separated from the response. It is only used to limit the buffer zone of headers, so its value is lower than proxy_buffers.
What is special about proxy_buffer_size is that proxy_buffer_size works regardless of whether proxy_buffering is turned on or not.
Proxy_busy_buffers_size
Proxy_busy_buffers_size 12k
The maximum value of buffer when busy. While a client can only read data from one buffer at a time, the rest of the buffer will be queued to be sent to the client. This directive specifies the size of the buffer in this state.
①, if proxy_buffers shuts down,
Nginx will not attempt to get all the response data from the back-end server before returning it to the client. Nginx will send the data to the client as soon as possible. Before the data is transferred, the maximum cache size received by Nginx cannot exceed proxy_buffer_size.
②, if proxy_buffers is open,
Nginx will read the data from the back-end server to buffer as much as possible until all the buffer set by proxy_buffers is full or the data is read (EOF). At this time, Nginx begins to transmit data to the client, and the whole string of buffer will be transmitted at the same time. If the data is large, Nginx will receive it and write it to temp_file, and the size will be controlled by proxy_max_temp_file_size. "when the data is not fully read", the buffer size that Nginx sends to the client at the same time cannot exceed proxy_busy_buffers_size "this sentence may be misunderstood".
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.