In order to get output from stats socket, What parameter do I need to put in haproxy.cfg ?
I tried show errors, but nothing returned. [www@front tmp]$ echo "show errors" | sudo socat stdio /tmp/haproxysock Total events captured on [20/Jun/2014:15:24:13.979] : 0 My haproxy.cfg [www@front log]$ cat /etc/haproxy/haproxy.cfg global #log 127.0.0.1 local0 notice log 127.0.0.1 local0 info ulimit-n 30000 maxconn 10000 nbproc 1 stats socket /tmp/haproxysock defaults log global mode http option httplog #option dontlog-normal retries 3 option redispatch contimeout 3000 clitimeout 50000 srvtimeout 50000 stats uri /haproxy stats enable stats realm Strictly\ Private stats auth h:h frontend http_frontend maxconn 12000 bind *:80 mode http option forceclose option forwardfor reqrep ^([^\ :]*)\ /(.*) \1\ /rece/\2 reqadd X-Forwarded-Proto:\ http default_backend receivers backend receivers mode http balance roundrobin server s3 127.0.0.1:9080 check maxconn 32 server s4 127.0.0.1:8080 check maxconn 32 谢谢 金杰 (Jie Jin) On Fri, Jun 20, 2014 at 1:18 PM, Willy Tarreau <[email protected]> wrote: > Hi Jie Jin, > > On Fri, Jun 20, 2014 at 11:55:54AM +0800, Jie Jin wrote: > > Hi, all > > > > Finally, I got some log and screenshot from the haproxy. > > > > We use haproxy 1.4.25. But recently we met a problem: so many 4xx > requests, > > nearly 6% - 8%. > > > > I want to know why so many 400 requests, and fix it. > > > > I have analyze the log, most of the 4xx requests are 400 requests which > > marked as BADREQ > > below is the sample of log, ip address has been anonymized. (Our clients > > continuously send a heartbeat every 30 seconds) > > Then I suspect that your client's heartbeats are bogus. When you get a > BADREQ, you should issue "show errors" on the stats socket to get a full > dump of it. It will contain a full dump of the exact request it received > and indicate what was found wrong there. > > Regards, > Willy > >

