<div dir="ltr">Hey,<br>It&#39;s gets even weirder. I found out that if I limit the download speed, I can get the whole file.<br><br>Could anyone confirm that this works:<br>wget --limit-rate=3500 <a href="http://www.noal.org.il/static/temp/barvazi2.pdf">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
while this doesn&#39;t:<br>wget <a href="http://www.noal.org.il/static/temp/barvazi2.pdf">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br><br>Thank you.<br>Yo&#39;av<br><br><div class="gmail_quote">On Tue, Jan 20, 2009 at 12:08 PM, Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Tue, Jan 20, 2009 at 11:45:13AM +0200, Yo&#39;av Moshe wrote:<br>
<br>
&gt; Sorry, but it is still the same... server is now running the modified nginx,<br>
&gt; but this file still can&#39;t be fetched:<br>
&gt; <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a> .<br>
&gt; I just can&#39;t think what the problem might be.<br>
&gt;<br>
&gt; If it helps, my VPS is running CentOS 5.2 with kernel 2.6.18.<br>
&gt;<br>
&gt; Any more tests I can run?<br>
<br>
</div>The patch tries to sendfile() until EAGAIN, even it already said<br>
that it sent smaller chunk than it was requested.<br>
<br>
Could you create a new strace and grep single pid to ensure that<br>
nginx calls sendfile() until EAGAIN ?<br>
<br>
If the patch does not help, I suspect a bug in kernel/VPS/etc, as kernel<br>
does not return event via epoll_wait().<br>
<div><div></div><div class="Wj3C7c"><br>
&gt; Thanks again.<br>
&gt; Yo&#39;av.<br>
&gt;<br>
&gt;<br>
&gt; 2009/1/20 Igor Sysoev &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;<br>
&gt;<br>
&gt; &gt; On Tue, Jan 20, 2009 at 02:59:34AM +0200, Yo&#39;av Moshe wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; Thanks.<br>
&gt; &gt; &gt; I&#39;m not an strace guru but I don&#39;t think it shows anything unusual...<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; <a href="http://paste-it.net/public/mffe731/" target="_blank">http://paste-it.net/public/mffe731/</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; You can see download starts right at the beginning, and at 02:25:25 you<br>
&gt; &gt; can<br>
&gt; &gt; &gt; see the last sendfile64 event. After that, no data was sent and I<br>
&gt; &gt; couldn&#39;t<br>
&gt; &gt; &gt; find anything related to that in this strace log.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The only thing this strace log is telling me is that nginx knows that<br>
&gt; &gt; there<br>
&gt; &gt; &gt; is still more data to send, since it recognized the right size of the<br>
&gt; &gt; file<br>
&gt; &gt; &gt; in the beginning (line 13: sendfile64(22, 23, [0], *1950230)*), and it<br>
&gt; &gt; knows<br>
&gt; &gt; &gt; it has more to send by the last sendfile event (line 1173: sendfile64(22,<br>
&gt; &gt; &gt; 23, [1618265], *331965*)).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; What stops the sending?<br>
&gt; &gt;<br>
&gt; &gt; Looking at these lines:<br>
&gt; &gt;<br>
&gt; &gt; 2140 &nbsp;02:25:24 epoll_wait(11, &nbsp;&lt;unfinished ...&gt;<br>
&gt; &gt; 2140 &nbsp;02:25:24 &lt;... epoll_wait resumed&gt; {{EPOLLOUT, {u32=140043201,<br>
&gt; &gt; u64=13817743186826159041}}}, 512, 22224) = 1<br>
&gt; &gt; 2140 &nbsp;02:25:24 gettimeofday({1232411124, 913871}, NULL) = 0<br>
&gt; &gt; 2140 &nbsp;02:25:24 sendfile64(22, 23, [1559225], 391005) = 28800<br>
&gt; &gt;<br>
&gt; &gt; 2140 &nbsp;02:25:24 epoll_wait(11, {{EPOLLOUT, {u32=140043201,<br>
&gt; &gt; u64=13817743186826159041}}}, 512, 22077) = 1<br>
&gt; &gt; 2140 &nbsp;02:25:25 gettimeofday({1232411125, 66164}, NULL) = 0<br>
&gt; &gt; 2140 &nbsp;02:25:25 sendfile64(22, 23, [1588025], 362205) = 30240<br>
&gt; &gt;<br>
&gt; &gt; 2140 &nbsp;02:25:25 epoll_wait(11, {{EPOLLOUT, {u32=140043201,<br>
&gt; &gt; u64=13817743186826159041}}}, 512, 21924) = 1<br>
&gt; &gt; 2140 &nbsp;02:25:25 gettimeofday({1232411125, 211986}, NULL) = 0<br>
&gt; &gt; 2140 &nbsp;02:25:25 sendfile64(22, 23, [1618265], 331965) = 28800<br>
&gt; &gt;<br>
&gt; &gt; I see that client socket (22) is associated with u64=13817743186826159041<br>
&gt; &gt; in epoll. Also I see that the socket was added and modified in epoll<br>
&gt; &gt; in the start of the transfer:<br>
&gt; &gt;<br>
&gt; &gt; 2140 &nbsp;02:25:12 epoll_ctl(11, EPOLL_CTL_ADD, 22, {EPOLLIN|EPOLLET,<br>
&gt; &gt; {u32=140043201<br>
&gt; &gt; , u64=579069412499841985}}) = 0<br>
&gt; &gt;<br>
&gt; &gt; 2140 &nbsp;02:25:12 epoll_ctl(11, EPOLL_CTL_MOD, 22, {EPOLLIN|EPOLLOUT|EPOLLET,<br>
&gt; &gt; {u32=140043201, u64=13817743186826159041}}) = 0<br>
&gt; &gt;<br>
&gt; &gt; However, I do not see socket deletion from epoll or closing.<br>
&gt; &gt; I see only that after 02:25:25 epoll_wait(), i.e. kernel, never<br>
&gt; &gt; returned any events about 22 socket.<br>
&gt; &gt;<br>
&gt; &gt; You may try the attached patch.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Igor Sysoev<br>
&gt; &gt; <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Yo&#39;av Moshe<br>
<br>
</div></div>--<br>
<div><div></div><div class="Wj3C7c">Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Yo&#39;av Moshe<br>
</div>