有没有办法模拟这些错误?我为它创建了一些自定义文件,但我想确保它们显示正确。我为每个虚拟主机发送了不同的消息。
先感谢您。
我正在运行一个包含大量编码的文件。处理 500 个用户大约需要 55 秒,但现在我必须处理 1000 个用户。默认超时是 60 秒,所以我必须增加 FastCGI 读取超时。
我在 StackOverflow 上发现了这个问题,说我必须增加,fastcgi_read_timeout但我不知道把它放在哪里fastcgi.conf。
所以我的HAProxy配置和这个类似。
listen webaustin 0.0.0.0:80
mode http
timeout connect 12000
timeout server 60000
timeout queue 120000
balance roundrobin
option httpchk GET /index.html
log global
option httplog
option dontlog-normal
server web1 10.10.10.101:80 maxconn 600 check fall 10
server web2 10.10.10.102:80 maxconn 600 check fall 10
server web3 10.10.10.103:80 maxconn 600 check fall 10
server web4 10.10.10.104:80 maxconn 600 check fall 10
Run Code Online (Sandbox Code Playgroud)
这对我们的系统非常有效,四个后端网络服务器,一个前端网络服务器,超时设置合理。
我的问题是,我有一个 URL,我需要更长的超时时间。这是一项非常繁重的任务,在后端需要很长时间。
无论如何要更改单个 URL 的超时变量?
数周以来,我一直在为这个问题而苦苦挣扎,但我的想法已经不多了。我运行 HAProxy 以根据请求的路径/标头在 3 个后端之间代理请求。
我的后端是:
最后一个后端 (prerender.io) 似乎有零问题(尽管它的流量很少)。另外两个随机向客户端返回 504 错误(根据日志大约每分钟一次,但没有明确的模式)。
这是我的(消毒)配置:
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5s
timeout client 120s
timeout server 120s
frontend foobar
mode http
bind *:80
bind *:443 ssl crt /etc/ssl/certs/foobar.com.pem
redirect scheme https code 301 if !{ ssl_fc }
default_backend s3
acl api path_beg -i /api/
use_backend node if api
acl user-agent-bot hdr_sub(User-Agent) -i baiduspider twitterbot facebookexternalhit
use_backend …Run Code Online (Sandbox Code Playgroud)