<div dir="ltr">Igor, I tried using select instead of poll, but I get the exact same problem.<br><br>Check my strace:<br><a href="http://pastebin.com/m65056ec0">http://pastebin.com/m65056ec0</a><br><br>I get the same thing with rtsig too.<br>
<br>Hints?<br>Again, file is at <a href="http://www.noal.org.il/static/temp/hozer.pdf">http://www.noal.org.il/static/temp/hozer.pdf</a>. Server is using select now.<br><br>Thanks...<br>Yo'av.<br><br><div class="gmail_quote">
On Fri, Jan 23, 2009 at 3:05 PM, Igor Sysoev <span dir="ltr"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></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 Fri, Jan 23, 2009 at 02:35:00PM +0200, Yo'av Moshe wrote:<br>
<br>
> Thanks Igor.<br>
> I don't want to be rude, but I find it hard to believe that it's a kernel<br>
> bug.<br>
><br>
> First, I'm using the default CentOS 5.2 kernel, it's seems to me pretty odd<br>
> that there's such a bug in it. CentOS is being used on a lot of servers,<br>
> some of them must be running nginx.<br>
><br>
> Second, I tried serving the same file with thttpd, and it runs just fine.<br>
> <a href="http://195.28.180.147:40/temp/hozer.pdf" target="_blank">http://195.28.180.147:40/temp/hozer.pdf</a><br>
> Note it's the exact same file which I cannot get from nginx:<br>
> <a href="http://www.noal.org.il/static/temp/hozer.pdf" target="_blank">http://www.noal.org.il/static/temp/hozer.pdf</a><br>
><br>
> How come thttpd can serve the file just fine? If it's a kernel bug, I<br>
> thought it would happen with all of my servers.<br>
> If it's using some different way of sending the files which does not depend<br>
> on that epoll call - is there any way to configure nginx to use that as<br>
> well?<br>
<br>
</div>I do not look modern thttpd, but according its change log, it has no<br>
epoll support. You may try different ways in nginx: you need to build it<br>
<br>
--with-rtsig_module<br>
--with-select_module<br>
--with-poll_module<br>
<br>
and then choose method:<br>
<br>
events {<br>
use select;<br>
#use poll;<br>
#use rtsig;<br>
}<br>
<br>
Also, epoll has two modes: level triggered (default) and edge<br>
triggered (EPOLLET). nginx uses more effective edge triggered mode,<br>
lighttpd uses level triggered one. The bug may be in ET mode only.<br>
<br>
As to probabilty of kernel bugs: I saw them in FreeBSD (kqueue, sendfile),<br>
Linux (epoll), Solaris (event ports), and MacOSX (kqueue, sendfile).<br>
<div class="Ih2E3d"><br>
> Can I do anything to confirm that it's a kernel bug? If it is, I should<br>
> probably contact CentOS's maintainers.<br>
<br>
</div>Your straces confirms this: nginx added socket to epoll and did not<br>
deleted it, nevertheless epoll does not send event.<br>
<div><div></div><div class="Wj3C7c"><br>
> Thank you, again.<br>
> Yo'av.<br>
><br>
> On Wed, Jan 21, 2009 at 7:26 AM, Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> wrote:<br>
><br>
> > On Wed, Jan 21, 2009 at 01:52:53AM +0200, Yo'av Moshe wrote:<br>
> ><br>
> > > Igor, here's the new strace.<br>
> > > <a href="http://pastebin.com/m5129c54b" target="_blank">http://pastebin.com/m5129c54b</a><br>
> > ><br>
> > > Does the fact it works in low download rates still makes you think it's a<br>
> > > kernel issue?<br>
> ><br>
> > Yes, this is seems like a kernel issue. Kernel excatly said (with EAGAIN)<br>
> > that there is no place to output data, but never returned a new<br>
> > notification<br>
> > via epoll_wait() about free space:<br>
> ><br>
> > 21420 01:39:43 <... epoll_wait resumed> {{EPOLLOUT, {u32=153137960,<br>
> > u64=13811628390360331048}}}, 512, 60000) = 1<br>
> > 21420 01:39:43 gettimeofday({1232494783, 413764}, NULL) = 0<br>
> > 21420 01:39:43 sendfile64(20, 21, [1645625], 304605) = 40320<br>
> > 21420 01:39:43 sendfile64(20, 21, [1685945], 264285) = -1 EAGAIN (Resource<br>
> > temporarily unavailable)<br>
> > 21420 01:39:43 epoll_wait(11, <unfinished ...><br>
> ><br>
> > This is probably some race condition inside kernel, that does not appear on<br>
> > low speed download.<br>
> ><br>
> > > Thank you, really!<br>
> > > And thanks, Kiril and Jeff, for confirming that!<br>
> > ><br>
> > > Yo'av.<br>
> > ><br>
> > ><br>
> > > On Tue, Jan 20, 2009 at 9:39 PM, Kiril Angov <<a href="mailto:kupokomapa@gmail.com">kupokomapa@gmail.com</a>><br>
> > wrote:<br>
> > ><br>
> > > > wget <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > --2009-01-20 21:36:00--<br>
> > <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > Resolving www.noal.org.il... 195.28.180.147<br>
> > > > Connecting to <a href="http://www.noal.org.il" target="_blank">www.noal.org.il</a>|195.28.180.147|:80... connected.<br>
> > > > HTTP request sent, awaiting response... 200 OK<br>
> > > > Length: 1950230 (1.9M) [application/pdf]<br>
> > > > Saving to: `barvazi2.pdf'<br>
> > > ><br>
> > > > 81% [=====================================> ] 1,596,665<br>
> > > > --.-K/s eta 5s<br>
> > > ><br>
> > > ><br>
> > > > wget -c <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > --2009-01-20 21:38:28--<br>
> > > > <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > Resolving www.noal.org.il... 195.28.180.147<br>
> > > > Connecting to <a href="http://www.noal.org.il" target="_blank">www.noal.org.il</a>|195.28.180.147|:80... connected.<br>
> > > > HTTP request sent, awaiting response... 206 Partial Content<br>
> > > > Length: 1950230 (1.9M), 305960 (299K) remaining [application/pdf]<br>
> > > > Saving to: `barvazi2.pdf'<br>
> > > ><br>
> > > > 100%[+++++++++++++++++++++++++++++++++++++++=======>] 1,950,230<br>
> > > > 295K/s in 1.0s<br>
> > > ><br>
> > > > 2009-01-20 21:38:30 (295 KB/s) - `barvazi2.pdf' saved [1950230/1950230]<br>
> > > ><br>
> > > ><br>
> > > > On Tue, Jan 20, 2009 at 9:31 PM, jeff emminger <<a href="mailto:jemminger@gmail.com">jemminger@gmail.com</a>><br>
> > > > wrote:<br>
> > > > >> Could anyone confirm that this works:<br>
> > > > >> wget --limit-rate=3500<br>
> > <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > >> while this doesn't:<br>
> > > > >> wget <a href="http://www.noal.org.il/static/temp/barvazi2.pdf" target="_blank">http://www.noal.org.il/static/temp/barvazi2.pdf</a><br>
> > > > >><br>
> > > > ><br>
> > > > > Confirmed<br>
> > > > ><br>
> > > > ><br>
> > > ><br>
> > > ><br>
> > ><br>
> > ><br>
> > > --<br>
> > > Yo'av Moshe<br>
> ><br>
> > --<br>
> > Igor Sysoev<br>
> > <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
> ><br>
> ><br>
><br>
><br>
> --<br>
> Yo'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'av Moshe<br>
</div>