Re: Add time spent in posix_fadvise() in I/O read time ?

Поиск
Список
Период
Сортировка
От Frédéric Yhuel
Тема Re: Add time spent in posix_fadvise() in I/O read time ?
Дата
Msg-id 8c4ec02f-763c-465c-adf3-801c8cbf02a5@dalibo.com
обсуждение исходный текст
Ответ на Add time spent in posix_fadvise() in I/O read time ?  (Frédéric Yhuel <frederic.yhuel@dalibo.com>)
Ответы Re: Add time spent in posix_fadvise() in I/O read time ?
Список pgsql-hackers

On 3/14/25 09:43, Frédéric Yhuel wrote:
> One thing I've noticed is that posix_fadvise(,,POSIX_FADV_WILLNEED) 
> isn't always non-blocking on Linux. As Ted Ts'o explains in this old 
> thread[1], it blocks when the request queue fills up.

When posix_fadvise() blocks, it doesn't seem to be completely off-cpu 
(but mostly, at least on my machine), and I assume that this is the 
reason for the sentence "A value higher than needed to keep the disks 
busy will only result in extra CPU overhead" in the documentation for 
effective_io_concurrency? My guess is that Linux uses a spinlock 
somewhere, and that this explains the cpu overhead.

Also, on Linux, it seems we can control the size of the request queue 
with the /sys/block/XXX/queue/nr_requests setting. On my machine, it is 
set to 64 by default. When I set it up to 128, postgres spends less time 
on posix_fadvise(), and correspondingly more on pread().



В списке pgsql-hackers по дате отправления: