DESCRIPTION

Thrall is a standalone HTTP/1.1 server with keep-alive support. It uses threads instead pre-forking, so it works correctly on Windows. It is pure-Perl implementation which doesn't require any XS package.

COMMAND LINE OPTIONS

In addition to the options supported by plackup, Thrall accepts following options(s).

--max-workers=#

number of worker processes (default: 10)

--timeout=#

seconds until timeout (default: 300)

--keepalive-timeout=#

timeout for persistent connections (default: 2)

--max-keepalive-reqs=#

max. number of requests allowed per single persistent connection. If set to one, persistent connections are disabled (default: 1)

--max-reqs-per-child=#

max. number of requests to be handled before a worker process exits (default: 1000)

--min-reqs-per-child=#

if set, randomizes the number of requests handled by a single worker process between the value and that supplied by --max-reqs-per-chlid (default: none)

--spawn-interval=#

if set, worker processes will not be spawned more than once than every given seconds. Also, when SIGHUP is being received, no more than one worker processes will be collected every given seconds. This feature is useful for doing a "slow-restart". (default: none)

--main-thread-delay=#

the Thrall does not use signals or semaphores and it requires a small delay in main thread so it doesn't consume all CPU. (default: 0.1)

enables UNIX socket support. The IO::Socket::UNIX module is required. The socket file have to be not yet created. The first character @ or \0 in the socket file name means that abstract socket address will be created. (default: none)

NOTES

Thrall was started as a fork of Starlet server. It has almost the same code as Starlet and it was adapted to use threads instead fork().

Thrall is very slow on first request for each thread. It is because spawning new thread is slow in Perl itself. Thrall is very fast on another requests and generally is faster than any implementation which uses fork.

BUGS

There is a problem with Perl threads implementation which occurs on Windows. Some requests can fail with message:

failed to set socket to nonblocking mode:An operation was attempted on
something that is not a socket.