Hello list!

Hunting down a rather huge number of syscall peaks on the (FreeBSD) server, I found that uwsgi (2.0.14) issued read() calls with size 1 for data POST-ed from nginx to the uwsgi application. Turned out, I had "post-buffering=1" in the config, remnant from earlier times when I had issues as described here:

http://stackoverflow.com/questions/3970495/nginx-connection-reset-response-from-uwsgi-lost

Now, the suggestion there was post-buffering=1, and help for the option (uwsgi --help), the only official help on it I could find, states:

--post-buffering set size in bytes after which will buffer to disk instead of memory --post-buffering-bufsize set buffer size for read() in post buffering mode

So none of that suggests that post-buffering sets a buffer size of that many bytes, it suggests that the option is some kind of threshold size, AFTER WHICH incoming post data would be buffered on disk, and that post-buffering-bufsize is the buffer size used for read()!

However, that does not seem to be the case. post-buffering-bufsize seems to be completely ignored, and post-buffering is value of the buffer size used by read() calls, here's an example trace:

kevent(4,0x0,0,{ 3,EVFILT_READ,0x0,0x0,0x1,0x0 },1,0x0) = 1 (0x1)
accept(3,{ AF_INET 10.0.0.4:14208 },0x801df410c) = 7 (0x7)
read(7,"\0\b\^D\0\f\0QUERY_STRING \0file"...,65539) = 16332 (0x3fcc)
getpid()                                         = 68991 (0x10d7f)
getpid()                                         = 68991 (0x10d7f)
getpid()                                         = 68991 (0x10d7f)
getpid()                                         = 68991 (0x10d7f)
getpid()                                         = 68991 (0x10d7f)
getpid()                                         = 68991 (0x10d7f)
stat("/tmp",{ mode=drwxrwxrwt ,inode=24,size=8,blksize=4096 }) = 0 (0x0)
open("/tmp/uwsgieZ9AeA",O_RDWR|O_CREAT|O_EXCL,0600) = 10 (0xa)
unlink("/tmp/uwsgieZ9AeA")                       = 0 (0x0)
fcntl(10,F_GETFL,)                               = 2 (0x2)
fstat(10,{ mode=-rw------- ,inode=17992,size=0,blksize=131072 }) = 0 (0x0) read(7,0x801df8000,1) ERR#35 'Resource temporarily unavailable'
poll({ 7/POLLIN },1,4000)                        = 1 (0x1)
read(7,"\M-w",1)                                 = 1 (0x1)
read(7,"\M-#",1)                                 = 1 (0x1)
read(7,"\M-l",1)                                 = 1 (0x1)
read(7,"\M-f",1)                                 = 1 (0x1)
.
.
.

The FD 7 here was the nginx -> uwsgi connection, the server is connected over TCP because they're different machines.


Is this a bug in the code, code ported to FreeBSD, config parser or config documentation?


Thanks!


--

Vlad K.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to