In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Process description:
Visit the new project website to find static resources to obtain failed, pictures often can not be displayed, refresh occasionally pictures can be displayed.
Check the nginx log and find that there is an error in error.log:
[2017-07-21 22:53:12 [warn] 22402: * 484an upstream response is buffered to a temporary file / var/tmp/nginx/proxy//6/01/0000000016 while reading upstream, client: xxx.xxx.xxx.xxx, server: wap.xxxxxxxxx.com, request: "GET / source/p_w_picpaths/applyfristbg.jpg HTTP/1.1", upstream: "http://127.0.0.1:8081/source/p_w_picpaths/applyfristbg.jpg"," Host: "wap.xxxxxxxxx.com", referrer: "http://wap.xxxxxxxxx.com/source/css/apply-first-7ae1ca00a910468d350b293787c7e95dfbebd675.css"]
Second, through the study, we know that:
1. Because the default buffer of nginx is too small, insufficient cache will occur when the request header header is too large, which will be written to disk, resulting in access interruption.
2. Then contact the front end to learn that the front end is for SEO, adding a lot of Chinese words to header. Header is called a big.
Third, the solution:
Because the proxy done by nginx in nginx+tomcat is a reverse proxy, it is not valid to modify fastcgi_buffer_* in nginx+tomcat mode, and the corresponding buffer size of proxy needs to be modified.
1. For (php | python) + nginx, it can be set to:
Fastcgi_buffer_size 512k
Fastcgi_buffers 6 512k
Fastcgi_busy_buffers_size 512k
Fastcgi_temp_file_write_size 512k
2. For tomcat+nginx, you can set it to:
Proxy_buffering off; # enables response content buffering from the backend proxied server
Proxy_buffer_size 128k; # sets the size and number of buffers
Proxy_buffers 100 128k; #
Client_max_body_size 100m
For the actual size of the modification, it needs to be based on the actual situation.
Third, the principle of online inquiry:
How buffer works
The first concept is that all these proxy buffer parameters apply to each request. Each request will get its own buffer according to the configuration of the parameters. Proxy buffer is not global but per request.
Proxy_buffering is to enable response buffering of the proxied server, and the parameters proxy_buffers and proxy_busy_buffers_size will not take effect until it is enabled.
Proxy_buffer_size (main buffer) works regardless of whether proxy_buffering is enabled or not. The buffer_size set by proxy_buffer_size is used to store the header of upstream response.
With proxy_buffering turned on, Nginx will read all the data transmitted by the upstream side to buffer as much as possible until all the buffer set by proxy_buffers is full or the data is read (EOF). At this point, the nginx begins to transmit data to the client, and the entire string of buffer will be transmitted at the same time. At the same time, if the content of the response is large, the Nginx will receive it and write them to the temp_file. The size is controlled by proxy_max_temp_file_size. If the buffer transmission of the busy is finished, the data will be read from the temp_file until the transmission is completed.
Once the buffer set by proxy_buffers is written, until the data in the buffer is fully transferred (transferred to the client), the buffer will always be in the busy state, and we cannot do anything else with the buffer. All buffer size in busy state cannot be added up to exceed proxy_busy_buffers_size, so proxy_busy_buffers_size is used to control the number of buffer transferred to the client at the same time.
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.