News for hackers. Stuff that matters.
Re:Thread Pools in Nginx Boost Performance 9x (2015) by vbezhenar on Monday August 14, 2017 @05:09AM (#15007400)
Why files can't be read without blocking with Linux? There's certainly an API for this.
Re:Thread Pools in Nginx Boost Performance 9x (2015) by nemanjaboric on Monday August 14, 2017 @05:26AM (#15007460)
Which API are you referring to? If you're referring to `aio_` that's just glibc's user-space thread-pool emulation of the POSIX's asynchronous IO + many operations needed for the truly async IO are not supported (such as `stat` and `open`). There's `io_` syscalls family, but that's not in the ready-to-use state yet, judging by the manpages and various patches being submitted every month.
Re:Thread Pools in Nginx Boost Performance 9x (2015) by vbezhenar on Monday August 14, 2017 @06:50AM (#15007759)
I'm referring to `fcntl(fd, F_SETFL, flags | O_NONBLOCK)`. `stat`, `open` are blocking, yes, didn't think about that. Also according to [1] file operations will always block, even in non-blocking mode, so I was wrong, sorry.

1: https://www.remlab.net/op/nonblock.shtml

Re:Thread Pools in Nginx Boost Performance 9x (2015) by signa11 on Monday August 14, 2017 @07:04AM (#15007819)
> ... Also according to [1] file operations will always block ...

not quite :) look at aio(7)

Re:Thread Pools in Nginx Boost Performance 9x (2015) by signa11 on Monday August 14, 2017 @05:24AM (#15007452)
> Why files can't be read without blocking with Linux? There's certainly an API for this.

i guess you are referring to aio(7) ? posix aio on linux is implemented in glibc, and doesn't scale in presence of multiple threads. which is probably what is alluded to...

Re:Thread Pools in Nginx Boost Performance 9x (2015) by biokoda on Monday August 14, 2017 @06:39AM (#15007709)
io_ syscalls only really work on XFS and require O_DIRECT which means kernel is not caching anything. Unsuitable for web servers.