nginx stress test 502 504 error

WBOY
Release: 2016-07-29 09:12:33
Original
2032 people have browsed it

The project frequently had 502 504 errors during stress testing. Through various troubleshooting, we finally found the problem. It was caused by tcp access timeout.

tcp_nodelay on;

fastcgi_connect_timeout 600;

fastcgi_send_timeout 600;

fastcgi_read _timeout 600;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;


nginx proxy: connect() to ip:80 failed (99: Cannot assign address requested)

modify /etc/sysctl.conf:

net.ipv4.tcp_timestamps = 1

net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 10000
net.ipv4.ip_nonlocal_bind = 1

sysctl -p

The following is tcp Introduction article of settings

http://blog.renhao.org/2010/07/setup-linux-kernel-tcp-settings/

The above introduces the nginx stress test 502 504 error, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template