Skip to content

Commit

Permalink
Add description about interactive thread pool (#1054)
Browse files Browse the repository at this point in the history
* Add description about interactive thread pool

* Update docs/src/server.md

---------

Co-authored-by: Jacob Quinn <[email protected]>
  • Loading branch information
AtsushiSakai and quinnj authored May 22, 2023
1 parent 3d91872 commit 3babef1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,9 @@ Lower-level core server functionality that only operates on `HTTP.Stream`. Provi
## Log formatting

Nginx-style log formatting is supported via the [`HTTP.@logfmt_str`](@ref) macro and can be passed via the `access_log` keyword argument for [`HTTP.listen`](@ref) or [`HTTP.serve`](@ref).

## Serving on the interactive thead pool

Beginning in Julia 1.9, the main server loop is spawned on the [interactive threadpool](https://docs.julialang.org/en/v1.9/manual/multi-threading/#man-threadpools) by default. If users do a Threads.@spawn from a handler, those threaded tasks should run elsewhere and not in the interactive threadpool, keeping the web server responsive.

Note that just having a reserved interactive thread doesn’t guarantee CPU cycles, so users need to properly configure their running Julia session appropriately (i.e. ensuring non-interactive threads available to run tasks, etc).

0 comments on commit 3babef1

Please sign in to comment.