This is the quux-hunchentoot Reference Manual, version 1.0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:29:38 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
quux-hunchentoot
Thread pooling for hunchentoot
Francois-Rene Rideau
MIT
1.0.2
hunchentoot
(system)., at least version "1.2.17"
alexandria
(system).
bordeaux-threads
(system).
lil
(system).
lparallel
(system).
trivia
(system).
pkgdcl.lisp
(file).
thread-pooling.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
quux-hunchentoot/quux-hunchentoot.asd
quux-hunchentoot/pkgdcl.lisp
quux-hunchentoot/thread-pooling.lisp
quux-hunchentoot/quux-hunchentoot.asd
quux-hunchentoot
(system).
quux-hunchentoot/thread-pooling.lisp
pkgdcl.lisp
(file).
quux-hunchentoot
(system).
channel-recv
(function).
channel-send
(function).
decrement-taskmaster-thread-count
(method).
execute-acceptor
(method).
execute-acceptor
(method).
handle-incoming-connection
(method).
increment-taskmaster-thread-count
(method).
initialize-instance
(method).
shutdown
(method).
taskmaster-max-accept-count
(reader method).
taskmaster-max-thread-count
(reader method).
(setf taskmaster-thread-count)
(writer method).
taskmaster-thread-count
(reader method).
thread-pooling-taskmaster
(class).
too-many-taskmaster-requests
(method).
call-with-thread-pool
(function).
decrement-taskmaster-accept-count
(method).
dispatcher-recv
(generic function).
dispatcher-send
(generic function).
ensure-dispatcher-process
(generic function).
increment-taskmaster-accept-count
(method).
run-dispatcher-thread
(generic function).
taskmaster-accept-count
(reader method).
(setf taskmaster-accept-count)
(writer method).
taskmaster-bindings
(reader method).
(setf taskmaster-bindings)
(writer method).
taskmaster-context
(reader method).
(setf taskmaster-context)
(writer method).
taskmaster-dispatcher-channel
(reader method).
(setf taskmaster-dispatcher-channel)
(writer method).
taskmaster-dispatcher-process
(reader method).
(setf taskmaster-dispatcher-process)
(writer method).
taskmaster-master-lock
(reader method).
taskmaster-pending-connections
(reader method).
(setf taskmaster-pending-connections)
(writer method).
taskmaster-thread-pool
(reader method).
(setf taskmaster-thread-pool)
(writer method).
with-taskmaster-accessors
(macro).
with-thread-pool
(macro).
work-on-connection
(function).
Packages are listed by definition order.
quux-hunchentoot
alexandria
.
common-lisp
.
hunchentoot
.
lil/transform/classy
.
lparallel
.
trivia.level2
.
channel-recv
(function).
channel-send
(function).
thread-pooling-taskmaster
(class).
call-with-thread-pool
(function).
dispatcher-recv
(generic function).
dispatcher-send
(generic function).
ensure-dispatcher-process
(generic function).
run-dispatcher-thread
(generic function).
taskmaster-accept-count
(generic reader).
(setf taskmaster-accept-count)
(generic writer).
taskmaster-bindings
(generic reader).
(setf taskmaster-bindings)
(generic writer).
taskmaster-context
(generic reader).
(setf taskmaster-context)
(generic writer).
taskmaster-dispatcher-channel
(generic reader).
(setf taskmaster-dispatcher-channel)
(generic writer).
taskmaster-dispatcher-process
(generic reader).
(setf taskmaster-dispatcher-process)
(generic writer).
taskmaster-master-lock
(generic reader).
taskmaster-pending-connections
(generic reader).
(setf taskmaster-pending-connections)
(generic writer).
taskmaster-thread-pool
(generic reader).
(setf taskmaster-thread-pool)
(generic writer).
with-taskmaster-accessors
(macro).
with-thread-pool
(macro).
work-on-connection
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
) connection) ¶hunchentoot
.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
) &rest init-args) ¶Ensure the if MAX-ACCEPT-COUNT is supplied, that it is greater than MAX-THREAD-COUNT.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
)) ¶The maximum number of connections this taskmaster will accept
before refusing new connections. If supplied and an integer,
this must be greater than MAX-THREAD-COUNT.
The number of queued requests is the difference between MAX-ACCEPT-COUNT
and MAX-THREAD-COUNT. If NIL, then behave as if it were MAX-THREAD-COUNT.
If T, then keep accepting new connections until resources are exhausted (not recommended).
hunchentoot
.
thread-pooling-taskmaster
)) ¶The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
hunchentoot
.
thread-pooling-taskmaster
)) ¶The number of taskmaster processing threads currently running.
hunchentoot
.
thread-pooling-taskmaster
)) ¶The number of taskmaster processing threads currently running.
hunchentoot
.
thread-pooling-taskmaster
) connection) ¶hunchentoot
.
A taskmaster that maintains a pool of worker threads
and a queue of accepted connections to be processed.
If MAX-THREAD-COUNT is null, a new thread will always be created
when all existing workers are busy.
If MAX-THREAD-COUNT is supplied, the number of worker threads is
limited to that. Furthermore, if MAX-ACCEPT-COUNT is not supplied, an
HTTP 503 will be sent if the thread limit is exceeded. Otherwise, if
MAX-ACCEPT-COUNT is supplied, it must be greater than MAX-THREAD-COUNT;
in this case, requests are accepted up to MAX-ACCEPT-COUNT, and only
then is HTTP 503 sent.
It is important to note that MAX-ACCEPT-COUNT and the HTTP 503 behavior
described above is racing with the acceptor listen backlog. If we are receiving
requests faster than threads can be spawned and 503 sent, the requests will be
silently rejected by the kernel.
In a load-balanced environment with multiple Hunchentoot servers, it’s
reasonable to provide MAX-THREAD-COUNT but leave MAX-ACCEPT-COUNT null.
This will immediately result in HTTP 503 when one server is out of
resources, so the load balancer can try to find another server.
In an environment with a single Hunchentoot server, it’s reasonable
to provide both MAX-THREAD-COUNT and a somewhat larger value for
MAX-ACCEPT-COUNT. This will cause a server that’s almost out of
resources to wait a bit; if the server is completely out of resources,
then the reply will be HTTP 503.
multi-threaded-taskmaster
.
decrement-taskmaster-accept-count
.
decrement-taskmaster-thread-count
.
dispatcher-recv
.
dispatcher-send
.
ensure-dispatcher-process
.
execute-acceptor
.
execute-acceptor
.
handle-incoming-connection
.
increment-taskmaster-accept-count
.
increment-taskmaster-thread-count
.
initialize-instance
.
run-dispatcher-thread
.
shutdown
.
(setf taskmaster-accept-count)
.
taskmaster-accept-count
.
(setf taskmaster-bindings)
.
taskmaster-bindings
.
(setf taskmaster-context)
.
taskmaster-context
.
(setf taskmaster-dispatcher-channel)
.
taskmaster-dispatcher-channel
.
(setf taskmaster-dispatcher-process)
.
taskmaster-dispatcher-process
.
taskmaster-master-lock
.
taskmaster-max-accept-count
.
taskmaster-max-thread-count
.
(setf taskmaster-pending-connections)
.
taskmaster-pending-connections
.
(setf taskmaster-thread-count)
.
taskmaster-thread-count
.
(setf taskmaster-thread-pool)
.
taskmaster-thread-pool
.
too-many-taskmaster-requests
.
Initarg | Value |
---|---|
:max-thread-count | *default-max-thread-count* |
:max-accept-count | *default-max-accept-count* |
Thread-unsafe operations without a clear owner use this lock
(bordeaux-threads:make-lock "taskmaster-master")
This slot is read-only.
A process that dispatches connections to worker processes for handling, or withholds them when resources are missing.
:dispatcher-channel
A context function, taking a thunk as argument, and calling it within proper context, for workers in the thread pool.
(quote funcall)
:context
bindings (as an alist) to wrap around workers in the thread pool.
:bindings
A kernel to which to bind lparallel:*kernel* to handle the thread pool.
A list of pending connection socket
(lil/transform/classy:empty-fifo-queue)
:pending-connections
The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
(or integer null)
:max-thread-count
This slot is read-only.
The number of taskmaster processing threads currently running.
integer
0
The maximum number of connections this taskmaster will accept
before refusing new connections. If supplied and an integer,
this must be greater than MAX-THREAD-COUNT.
The number of queued requests is the difference between MAX-ACCEPT-COUNT
and MAX-THREAD-COUNT. If NIL, then behave as if it were MAX-THREAD-COUNT.
If T, then keep accepting new connections until resources are exhausted (not recommended).
(or integer boolean)
:max-accept-count
This slot is read-only.
The number of connection currently accepted by the taskmaster. These connections are not ensured to be processed, they may be waiting for an empty processing slot or rejected because the load is too heavy.
integer
0
thread-pooling-taskmaster
) &key &allow-other-keys) ¶thread-pooling-taskmaster
) message &key &allow-other-keys) ¶thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶The number of connection currently accepted by the taskmaster. These connections are not ensured to be processed, they may be waiting for an empty processing slot or rejected because the load is too heavy.
thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶bindings (as an alist) to wrap around workers in the thread pool.
thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶A context function, taking a thunk as argument, and calling it within proper context, for workers in the thread pool.
thread-pooling-taskmaster
)) ¶automatically generated reader method
thread-pooling-taskmaster
)) ¶automatically generated writer method
thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶A process that dispatches connections to worker processes for handling, or withholds them when resources are missing.
thread-pooling-taskmaster
)) ¶Thread-unsafe operations without a clear owner use this lock
thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶A list of pending connection socket
thread-pooling-taskmaster
)) ¶thread-pooling-taskmaster
)) ¶A kernel to which to bind lparallel:*kernel* to handle the thread pool.
thread-pooling-taskmaster
)) ¶hunchentoot
.
thread-pooling-taskmaster
)) ¶hunchentoot
.
Jump to: | (
C D E F G H I M R S T W |
---|
Jump to: | (
C D E F G H I M R S T W |
---|
Jump to: | A B C D M P S T |
---|
Jump to: | A B C D M P S T |
---|
Jump to: | C F P Q S T |
---|
Jump to: | C F P Q S T |
---|