Commit f08472bb authored by Nils Goroll's avatar Nils Goroll

doc: minor clarifications on workspace_prealloc

parent 05cebd46
...@@ -263,24 +263,25 @@ See the detailled discussion in `THREADS`_ for details. ...@@ -263,24 +263,25 @@ See the detailled discussion in `THREADS`_ for details.
$Function VOID workspace_prealloc(BYTES min_free=4096, INT max_nodes=32) $Function VOID workspace_prealloc(BYTES min_free=4096, INT max_nodes=32)
Configure workspace pre-allocation of objects in variable-sized Configure the amount of workspace used for pesi internal data
internal data structures. structures.
For each request, the VDP builds such a structure, whose size is The pesi VDP builds a structure, whose size is roughly proportional to
roughly proportional to the size of the ESI tree -- the conceptual the size of the ESI tree -- the conceptual tree with the top-level
tree with the top-level response at the root, and its includes and all response at the root, and its includes and all of their nested
of their nested includes as branches. The nodes in this structure have includes as branches. The nodes in this structure have a fixed size,
a fixed size, but the number of nodes used by the VDP varies with the but the number of nodes used by the VDP varies with the size of the
size of the ESI tree. ESI tree.
The VDP pre-allocates a constant number of such nodes in client For each (sub)request, the VDP pre-allocates a constant number of such
workspace, and initially takes nodes from the pre-allocation. If more nodes in client workspace, and initially uses the pre-allocation for
are needed for larger ESI trees, they are obtained from a global child nodes of that (sub)request. If more are needed, they are
memory pool as described below. The use of pre-allocated nodes from obtained from a global memory pool as described below. The use of
workspace is preferred, since it never requires new system memory pre-allocated nodes from workspace is preferred, since it never
allocations (workspaces themselves are pre-allocated by Varnish), and requires new system memory allocations (workspaces themselves are
because they are local to each request, so locking is never required pre-allocated by Varnish), and because they are local to each request,
to access them (but is required for the memory pool). so locking is never required to access them (but is required for the
memory pool).
The pre-allocation contributes a fixed size to client workspace usage, The pre-allocation contributes a fixed size to client workspace usage,
since the number of pre-allocated nodes is constant. So any adjustment since the number of pre-allocated nodes is constant. So any adjustment
...@@ -296,7 +297,11 @@ pre-allocation will always leave free in client workspace; if the ...@@ -296,7 +297,11 @@ pre-allocation will always leave free in client workspace; if the
targeted number of pre-allocated nodes would result in less free space targeted number of pre-allocated nodes would result in less free space
than ``min_free`` bytes in workspace, then fewer nodes are than ``min_free`` bytes in workspace, then fewer nodes are
allocated. This ensures that free workspace is always left over for allocated. This ensures that free workspace is always left over for
other VMODs, VCL usage, and so forth. ``min_free`` defaults to 4 KiB. other VMODs, VCL usage, and so forth. Note that most of the operations
typically requiring workspace have already finished when VDP pesi
makes the pre-allocation, because it starts after `vcl_deliver
{}`. Thus, the reservation is mostly for other VDPs and VMODs using
`PRIV_TOP`. ``min_free`` defaults to 4 KiB.
The ``max_nodes`` parameter sets the number of nodes to be allocated, The ``max_nodes`` parameter sets the number of nodes to be allocated,
unless the limit imposed by ``min_free`` is exceeded; ``max_nodes`` unless the limit imposed by ``min_free`` is exceeded; ``max_nodes``
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment