I think the key question is why it is trying to "sendfile" *4294967295 *bytes 
of data if file is only *614770 *bytes big?

If you look at the source code 
(https://github.com/firebase/nginx/blob/master/src/os/unix/ngx_linux_sendfile_chain.c)
 
and implementation of ngx_linux_sendfile it does this:

ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"sendfile: @%O %uz", file->file_pos, size);
n = sendfile(c->fd, file->file->fd, &offset, size);
... - error handling

ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, "sendfile: %z of %uz @%O",
n, size, file->file_pos)
so why n (equal to what was returned by sendfile() was   *4294967295?*

It looks like sendfile() lied about bytes copied between descriptors. Why?

Waldek

On Thursday, August 31, 2017 at 9:14:06 AM UTC-4, Waldek Kozaczuk wrote:
>
> Recently I have been playing with nginx on OSv and seeing some errors on 
> client side (web browser or ab - Apache benchmark) tool.
>
> In general all works fine when I make single request to fetch individual 
> file. However when I use ab to fetch same file (around 600K big) 
> concurrently 5 times some of the requests fail (2-4 of 5) with dropped 
> connections. It seems that ab is only getting subset of data for those 
> failed requests.
>
> In the browser when I try to reload entire HTML page that involves 
> fetching 10 or more resources simultaneously most GET requests succeed but 
> some fail eventually with error like so :net::ERR_CONTENT_LENGTH_MISMATCH 
> which seems to indicate that data received was different from what was 
> advertised in Content-Length header received initially from nginx.
>
> I bumped up the nginx error log settings to debug and I have not seen any 
> errors. However in case of 5 concurrent requests scenario I only saw it 
> handle only 4 requests. Is it because OSv drops connections prematurely? Or 
> is it because I am testing it on qemu on OSx and there is some limitation 
> around virtual networking and timeouts.
>
> Here are my QEMU arguments:
> /usr/local/bin/qemu-system-x86_64 -nographic -m 1024 -smp 4 -device 
> virtio-blk-pci,id=blk0,bootindex=0,drive=hd0 -drive 
> file=/my_app/disk.qcow2,if=none,id=hd0,aio=threads,cache=unsafe -device 
> virtio-rng-pci -chardev stdio,mux=on,id=stdio,signal=off -device 
> isa-serial,chardev=stdio -netdev user,id=un0,net=
> 192.168.122.0/24,host=192.168.122.1,hostfwd=tcp::8000-:8000,hostfwd=tcp::8080-:80
>  
> -device virtio-net-pci,netdev=un0 -chardev 
> socket,id=charmonitor,path=/my_app/osv.monitor,server,nowait -mon 
> chardev=charmonitor,id=monitor,mode=control
>
> Please see attached ab outputs and nginx log outputs for both single 
> request and 5 concurrent requests. How can I better debug the problem? User 
> traffic sniffer on host side or connect to OSv using debugger? If debugger 
> then where in call stack put breakpoint?
>
> I appreciate help solving this problem. I am trying to port existing 
> static HTML5 app from Apache on Linux to nginx on OSv and would love to see 
> it fully work.
>
> Regards,
> Waldek
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to