Hi,
About the health-chk fail issue, Attaching the strace trace.
(Please ignore the RST issue in my earlier mail - that was local issue-
fixed)
Health-chk send msg is OK.
the recv immediately thereafter fails (EAGAIN)
the next receive succeeds.
still, not good enough for Server to be declared UP.
-Sanjeev Kumar
On Mon, May 25, 2009 at 4:34 AM, Sanjeev Kumar <[email protected]>wrote:
> My application on real-server(on port 9123) is responding to http health as
> follows:
>
> http health chk Cmd >> HEAD /check.txt HTTP/1.0
> server health chk resp> HTTP/1.0 200 OK
>
> On the debian-linux on which HAproxy is running, I can see tcp-connection &
> cmd-resp exch using Wireshark analyzer. HAproxy sends few healthchk and
> then RST the socket.
> But HAproxy doesn't accept the health chk resp, indicating server Down.
>
> This time, I ran the HAproxy under strace .
>
> I see the connect to remote socket is Ok.
> But send returns EAGAIN and the recv also return EAGAIN(resource
> temporaility unavailable).
> what am I doing wrong?
>
>
> My config file.
>
> ##
> global
> log 127.0.0.1 local0
> maxconn 100
> user root
> group root
> debug
>
> defaults
> log global
> timeout connect 10s
>
> listen vproxy *:9123
> mode tcp
> option tcplog
> option httpchk HEAD /check.tst HTPP/1.0
> server servA 192.168.2:9123 check
>
> thanks,
> -sanjeev kumar
>
execve("./haproxy", ["haproxy", "-f", "haproxy.cfg"], [/* 33 vars */]) = 0
brk(0) = 0x8090000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ee9000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=46615, ...}) = 0
mmap2(NULL, 46615, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7edd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1356196, ...}) = 0
mmap2(NULL, 1361520, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0xb7d90000
mmap2(0xb7ed7000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x147) = 0xb7ed7000
mmap2(0xb7eda000, 9840, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7eda000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7d8f000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7d8f6b0, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,
useable:1}) = 0
mprotect(0xb7ed7000, 4096, PROT_READ) = 0
munmap(0xb7edd000, 46615) = 0
brk(0) = 0x8090000
brk(0x80b1000) = 0x80b1000
gettimeofday({1243276956, 186554}, NULL) = 0
getpid() = 4558
uname({sys="Linux", node="debian", ...}) = 0
open("haproxy.cfg", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0666, st_size=598, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ee8000
read(3, "global\n log 127.0.0.1 local0\n"..., 4096) = 598
socket(PF_FILE, SOCK_STREAM, 0) = 4
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT
(No such file or directory)
close(4) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 4
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT
(No such file or directory)
close(4) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=513, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ee7000
read(4, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 513
read(4, "", 4096) = 0
close(4) = 0
munmap(0xb7ee7000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=46615, ...}) = 0
mmap2(NULL, 46615, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7d83000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libnss_compat.so.2", O_RDONLY) = 4
read(4, "\177elf\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\...@\16\0\000"..., 512) =
512
fstat64(4, {st_mode=S_IFREG|0644, st_size=30436, ...}) = 0
mmap2(NULL, 33352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) =
0xb7edf000
mmap2(0xb7ee6000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x6) = 0xb7ee6000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libnsl.so.1", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\00001\0\000"..., 512) =
512
fstat64(4, {st_mode=S_IFREG|0644, st_size=83708, ...}) = 0
mmap2(NULL, 96232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) =
0xb7d6b000
mmap2(0xb7d7f000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x13) = 0xb7d7f000
mmap2(0xb7d81000, 6120, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7d81000
close(4) = 0
munmap(0xb7d83000, 46615) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=46615, ...}) = 0
mmap2(NULL, 46615, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7d83000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libnss_nis.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\31\0"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=34352, ...}) = 0
mmap2(NULL, 37436, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) =
0xb7d61000
mmap2(0xb7d69000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x7) = 0xb7d69000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\30"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=38412, ...}) = 0
mmap2(NULL, 41624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) =
0xb7d56000
mmap2(0xb7d5f000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x8) = 0xb7d5f000
close(4) = 0
munmap(0xb7d83000, 46615) = 0
open("/etc/passwd", O_RDONLY|0x80000) = 4
fcntl64(4, F_GETFD) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
_llseek(4, 0, [0], SEEK_CUR) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=1228, ...}) = 0
mmap2(NULL, 1228, PROT_READ, MAP_SHARED, 4, 0) = 0xb7ede000
_llseek(4, 1228, [1228], SEEK_SET) = 0
munmap(0xb7ede000, 1228) = 0
close(4) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 4
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT
(No such file or directory)
close(4) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 4
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT
(No such file or directory)
close(4) = 0
open("/etc/group", O_RDONLY|0x80000) = 4
fcntl64(4, F_GETFD) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
_llseek(4, 0, [0], SEEK_CUR) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=735, ...}) = 0
mmap2(NULL, 735, PROT_READ, MAP_SHARED, 4, 0) = 0xb7ede000
_llseek(4, 735, [735], SEEK_SET) = 0
munmap(0xb7ede000, 735) = 0
close(4) = 0
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7ee8000, 4096) = 0
gettimeofday({1243276956, 193792}, NULL) = 0
time(NULL) = 1243276956
write(2, "Available polling systems :\n", 28Available polling systems :
) = 28
write(2, " sepoll : ", 14 sepoll : ) = 14
write(2, "pref=400, ", 10pref=400, ) = 10
epoll_create(213) = 3
close(3) = 0
write(2, " test result OK", 15 test result OK) = 15
write(2, "\n", 1
) = 1
write(2, " select : ", 14 select : ) = 14
write(2, "pref=150, ", 10pref=150, ) = 10
write(2, " test result OK", 15 test result OK) = 15
write(2, "\n", 1
) = 1
write(2, " epoll : ", 14 epoll : ) = 14
write(2, "disabled, ", 10disabled, ) = 10
epoll_create(213) = 3
close(3) = 0
write(2, " test result OK", 15 test result OK) = 15
write(2, "\n", 1
) = 1
write(2, " poll : ", 14 poll : ) = 14
write(2, "disabled, ", 10disabled, ) = 10
write(2, " test result OK", 15 test result OK) = 15
write(2, "\n", 1
) = 1
write(2, "Total: 4 (2 usable), will use se"..., 38Total: 4 (2 usable), will use
sepoll.
) = 38
epoll_create(213) = 3
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ee8000
write(1, "Using sepoll() as the polling me"..., 41Using sepoll() as the polling
mechanism.
) = 41
rt_sigaction(SIGQUIT, {0x8072000, [QUIT], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x8072000, [USR1], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGHUP, {0x8072000, [HUP], SA_RESTART}, {SIG_DFL}, 8) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
fcntl64(4, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_SOCKET, 0xf /* SO_??? */, [1], 4) = -1 ENOPROTOOPT (Protocol
not available)
bind(4, {sa_family=AF_INET, sin_port=htons(9123),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(4, 2000) = 0
open("/etc/localtime", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
fstat64(5, {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ede000
read(5, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0\0"..., 4096) =
3519
_llseek(5, -24, [3495], SEEK_CUR) = 0
read(5, "\nEST5EDT,M3.2.0,M11.1.0\n", 4096) = 24
close(5) = 0
munmap(0xb7ede000, 4096) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
setsockopt(5, SOL_SOCKET, SO_RCVBUF, [0], 4) = 0
shutdown(5, 0 /* receive */) = -1 ENOTCONN (Transport endpoint is
not connected)
sendto(5, "<133>May 25 14:42:36 haproxy[455"..., 63, MSG_DONTWAIT|MSG_NOSIGNAL,
{sa_family=AF_INET, sin_port=htons(514), sin_addr=inet_addr("127.0.0.1")}, 16)
= 63
rt_sigaction(SIGTTOU, {0x8072000, [TTOU], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGTTIN, {0x8072000, [TTIN], SA_RESTART}, {SIG_DFL}, 8) = 0
setrlimit(RLIMIT_NOFILE, {rlim_cur=212, rlim_max=212}) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=212, rlim_max=212}) = 0
gettimeofday({1243276956, 204304}, NULL) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 6
fcntl64(6, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
connect(6, {sa_family=AF_INET, sin_port=htons(9123),
sin_addr=inet_addr("192.168.1.2")}, 16) = -1 EINPROGRESS (Operation now in
progress)
send(6, "HEAD /check.txt; HTTP/1.0\r\n\r\n", 29, MSG_DONTWAIT|MSG_NOSIGNAL) =
-1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLOUT, {u32=6, u64=6}}) = 0
accept(4, 0xbfdb8e24, [128]) = -1 EAGAIN (Resource temporarily
unavailable)
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=4, u64=4}}) = 0
epoll_wait(3, {{EPOLLOUT, {u32=6, u64=6}}}, 7, 1000) = 1
gettimeofday({1243276956, 205690}, NULL) = 0
send(6, "HEAD /check.txt; HTTP/1.0\r\n\r\n", 29, MSG_DONTWAIT|MSG_NOSIGNAL) = 29
getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
recv(6, 0x8089d20, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily
unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=6, u64=6}}}, 7, 1000) = 1
gettimeofday({1243276956, 216557}, NULL) = 0
getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
recv(6, "HTTP/1.0 200 OK\r\n\r\n", 16384, MSG_NOSIGNAL) = 19
close(6) = 0
epoll_wait(3, {}, 5, 1000) = 0
gettimeofday({1243276957, 215432}, NULL) = 0
epoll_wait(3, {}, 5, 1000) = 0
gettimeofday({1243276958, 215439}, NULL) = 0
epoll_wait(3, {}, 5, 1000) = 0
gettimeofday({1243276959, 215421}, NULL) = 0
epoll_wait(3, {}, 5, 1000) = 0
gettimeofday({1243276960, 215435}, NULL) = 0
epoll_wait(3, {}, 5, 990) = 0
gettimeofday({1243276961, 207371}, NULL) = 0
epoll_wait(3, {}, 5, 10) = 0
gettimeofday({1243276961, 219337}, NULL) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 6
fcntl64(6, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
connect(6, {sa_family=AF_INET, sin_port=htons(9123),
sin_addr=inet_addr("192.168.1.2")}, 16) = -1 EINPROGRESS (Operation now in
progress)
send(6, "HEAD /check.txt; HTTP/1.0\r\n\r\n", 29, MSG_DONTWAIT|MSG_NOSIGNAL) =
-1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLOUT, {u32=6, u64=6}}) = 0
epoll_wait(3, {{EPOLLOUT, {u32=6, u64=6}}}, 7, 1000) = 1
gettimeofday({1243276961, 220533}, NULL) = 0
send(6, "HEAD /check.txt; HTTP/1.0\r\n\r\n", 29, MSG_DONTWAIT|MSG_NOSIGNAL) = 29
getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
recv(6, 0x8089d20, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily
unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
epoll_wait(3, {{EPOLLIN, {u32=6, u64=6}}}, 7, 1000) = 1
gettimeofday({1243276961, 231325}, NULL) = 0
getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
recv(6, "HTTP/1.0 200 OK\r\n\r\n", 16384, MSG_NOSIGNAL) = 19
close(6) = 0
epoll_wait(3, {}, 5, 1000) = 0
gettimeofday({1243276962, 231475}, NULL) = 0
epoll_wait(3, {}, 5, 1000) = 0