当前位置:Gxlcms > PHP教程 > nginx压测502504错误

nginx压测502504错误

时间:2021-07-01 10:21:17 帮助过:46人阅读

项目进行压测频繁有502 504错误通过各种排查终于找到了问题的所在,由于tcp访问超时导致

nginx.conf 设置

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 requested address)


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

下面是 tcp的设置的介绍文章

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

以上就介绍了nginx 压测502 504错误,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

人气教程排行