SSI bug with mutil include?
dr-dr xp
drdr.xp at gmail.com
Fri Aug 1 12:39:35 MSD 2008
hi nginx:
please give me some help or hint:
I encountered a problem while ssi delegaties back end memcached servers.
(ssi dispatches each include to a location with memcache_pass , which takes
use of upstream.)
ssi file looks like:
<!--# include virtual="/key?db_1" -->
<!--# include virtual="/key?db_2" -->
<!--# include virtual="/key?db_3" -->
....
After request for the url point to the ssi file, there is half of the
chances I cant get any response. Request is blocked for 60 seconds(the epoll
time-out) ends with nothing.
Sometimes I got the right response. the more include directives there are,
the more chances requests are blocked.
But if I add 'wait="yes"' attribute to each include, there will be no
problem.
I straced nginx, found that nginx closes the incorrect FD.
43 epoll_wait(8, {{EPOLLOUT, {u32=166951744, u64=13826368082478857024}},
{EPOLLOUT, {u32=166951824, u64=13826368082478857104}}, {EPOLLOUT,
{u32=166951664, u64=13826368082478856944}}, {EPOLLOUT, {u32=166951584,
u64=13826368082478856864}}, {EPOLLOUT, {u32=166951504,
u64=13826368082478856784}}, {EPOLLOUT, {u32=166951424,
u64=13826368082478856704}}, {EPOLLOUT, {u32=166951344,
u64=13826368082478856624}}, {EPOLLOUT, {u32=166951264,
u64=13826368082478856544}}, {EPOLLOUT, {u32=166951184,
u64=13826368580695062800}}}, 512, 60000) = 9
44 gettimeofday({1217429875, 344754}, NULL) = 0
45 getsockopt(16, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
46 writev(16, [{"get db_8\r\n", 10}], 1) = 10
47 getsockopt(15, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
48 writev(15, [{"get db_7\r\n", 10}], 1) = 10
49 getsockopt(14, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
50 writev(14, [{"get db_6\r\n", 10}], 1) = 10
51 getsockopt(13, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
52 writev(13, [{"get db_5\r\n", 10}], 1) = 10
53 getsockopt(12, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
54 writev(12, [{"get db_4\r\n", 10}], 1) = 10
55 getsockopt(11, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
56 writev(11, [{"get db_3\r\n", 10}], 1) = 10
57 getsockopt(10, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
58 writev(10, [{"get db_2\r\n", 10}], 1) = 10
59 getsockopt(9, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
60 writev(9, [{"get db_1\r\n", 10}], 1) = 10
61 recv(6, 0xbfe125db, 1, MSG_PEEK) = -1 EAGAIN (Resource
temporarily unavailable)
62
63 epoll_wait(8, {{EPOLLIN|EPOLLOUT, {u32=166951344,
u64=13826368082478856624}}, {EPOLLIN|EPOLLOUT, {u32=166951424,
u64=13826368082478856704}}, {EPOLLIN|EPOLLOUT, {u32=166951504,
u64=13826368082478856784}}, {EPOLLIN|EPOLLOUT, {u32=166951584,
u64=13826368082478856864}}, {EPOLLIN|EPOLLOUT, {u32=166951664,
u64=13826368082478856944}}, {EPOLLIN|EPOLLOUT, {u32=166951824,
u64=13826368082478857104}}, {EPOLLIN|EPOLLOUT, {u32=166951744,
u64=13826368082478857024}}}, 512, 59997) = 7
64 gettimeofday({1217429875, 346743}, NULL) = 0
65 recv(10, "VALUE db_2 0 1\r\n2\r\nEND\r\n", 100, 0) = 24
66 setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
67 close(9) = 0
68 recv(11, "VALUE db_3 0 1\r\n3\r\nEND\r\n", 100, 0) = 24
69 writev(6, [{"HTTP/1.1 200 OK\r\nServer: nginx/0"..., 165}, {"5\r\n", 3},
{"Var=[", 5}, {"\r\n", 2}, {"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n",
3}, {"2", 1}, {"\r\n", 2}], 10) = 187
70 close(10) = 0
71 recv(12, "VALUE db_4 0 1\r\n4\r\nEND\r\n", 100, 0) = 24
72 writev(6, [{"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n", 3}, {"3", 1},
{"\r\n", 2}], 6) = 12
73 close(11) = 0
74 recv(13, "VALUE db_5 0 1\r\n5\r\nEND\r\n", 100, 0) = 24
75 writev(6, [{"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n", 3}, {"4", 1},
{"\r\n", 2}], 6) = 12
76 close(12) = 0
77 recv(14, "VALUE db_6 0 1\r\n6\r\nEND\r\n", 100, 0) = 24
78 writev(6, [{"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n", 3}, {"5", 1},
{"\r\n", 2}], 6) = 12
79 close(13) = 0
80 recv(15, "VALUE db_7 0 1\r\n7\r\nEND\r\n", 100, 0) = 24
81 writev(6, [{"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n", 3}, {"6", 1},
{"\r\n", 2}], 6) = 12
82 close(14) = 0
83 recv(16, "VALUE db_8 0 1\r\n8\r\nEND\r\n", 100, 0) = 24
84 writev(6, [{"1\r\n", 3}, {",", 1}, {"\r\n", 2}, {"1\r\n", 3}, {"7", 1},
{"\r\n", 2}], 6) = 12
85 close(15) = 0
86 epoll_wait(8,
Anybody might had experienced such problem can help me? I'll be very
appreciated.
Is it a known bug?
I am trying to solve this problem, looking for something help through
source-codes.
--
要了几天饱饭就不记得西北风啥味了
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080801/8e05b581/attachment.html>
More information about the nginx
mailing list