diff options
author | Lukas Larsson <[email protected]> | 2014-01-27 12:01:45 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2014-01-27 14:48:50 +0100 |
commit | 0b36ce01e81744f4c0b41bfe1f62b4bf5d0ece97 (patch) | |
tree | ef403bfcfc33a41edb54309319a4cf39ca81ecab /lib/kernel/doc/src | |
parent | 045fcfc02ace59d07618f8983809236642bba630 (diff) | |
download | otp-0b36ce01e81744f4c0b41bfe1f62b4bf5d0ece97.tar.gz otp-0b36ce01e81744f4c0b41bfe1f62b4bf5d0ece97.tar.bz2 otp-0b36ce01e81744f4c0b41bfe1f62b4bf5d0ece97.zip |
erts/kernel: sendfile no longer uses async threads
This has been done because a slow client attack is possible if the
async thread pool is used. The scenario is:
Client does a request for a file and then slowly receives the file one
byte at a time. This will eventually fill the async thread pool with blocking
sendfile operations and thus starving the vm of all file operations.
If you still want to use the async threads pool for sendfile an option to
enable it has been introduced.
Diffstat (limited to 'lib/kernel/doc/src')
-rw-r--r-- | lib/kernel/doc/src/file.xml | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 0a4dd3ba47..e2c4aab27a 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -1746,16 +1746,16 @@ <item>The chunk size used by the erlang fallback to send data. If using the fallback, this should be set to a value which comfortably fits in the systems memory. Default is 20 MB.</item> + <tag><c>use_threads</c></tag> + <item>Instruct the emulator to use the async thread pool for the + sendfile system call. This could be usefull if the OS you are running + on does not properly support non-blocking sendfile calls. Do note that + using async threads potentially makes your system volnerable to slow + client attacks. If set to true and no async threads are available, + the sendfile call will return <c>{error,einval}</c>. + Introduced in 17.0. Default is false.</item> </taglist> </p> - <p>On operating systems with thread support, it is recommended to use - async threads. See the command line flag - <c>+A</c> in <seealso marker="erts:erl">erl(1)</seealso>. If it is not - possible to use async threads for sendfile, it is recommended to use - a relatively small value for the send buffer on the socket. Otherwise - the Erlang VM might loose some of its soft realtime guarantees. - Which size to use depends on the OS/hardware and the requirements - of the application.</p> </desc> </func> <func> |