diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2021-12-27 19:48:33 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2021-12-27 19:48:33 +0300 |
commit | 20c35434ef8d185cc70e8d68ef4730ce08f8b7d6 (patch) | |
tree | a26a95bdb97e61c0832d893a1dc037741ccb475a /src/core/ngx_connection.h | |
parent | f0a5ce136d8c0492123b16436467d367ed484d28 (diff) |
Simplified sendfile(SF_NODISKIO) usage.
Starting with FreeBSD 11, there is no need to use AIO operations to preload
data into cache for sendfile(SF_NODISKIO) to work. Instead, sendfile()
handles non-blocking loading data from disk by itself. It still can, however,
return EBUSY if a page is already being loaded (for example, by a different
process). If this happens, we now post an event for the next event loop
iteration, so sendfile() is retried "after a short period", as manpage
recommends.
The limit of the number of EBUSY tolerated without any progress is preserved,
but now it does not result in an alert, since on an idle system event loop
iteration might be very short and EBUSY can happen many times in a row.
Instead, SF_NODISKIO is simply disabled for one call once the limit is
reached.
With this change, sendfile(SF_NODISKIO) is now used automatically as long as
sendfile() is enabled, and no longer requires "aio on;".
Diffstat (limited to 'src/core/ngx_connection.h')
-rw-r--r-- | src/core/ngx_connection.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index 4716da492..8cc14755a 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -185,7 +185,7 @@ struct ngx_connection_s { unsigned need_last_buf:1; -#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT) +#if (NGX_HAVE_SENDFILE_NODISKIO || NGX_COMPAT) unsigned busy_count:2; #endif |