1Starlet(3) User Contributed Perl Documentation Starlet(3)
2
3
4
6 Starlet - a simple, high-performance PSGI/Plack HTTP server
7
9 % start_server --port=80 -- plackup -s Starlet [options] your-app.psgi
10
11 or if you do not need hot deploy,
12
13 % plackup -s Starlet --port=80 [options] your-app.psgi
14
16 Starlet is a standalone HTTP/1.1 web server, formerly known as
17 Plack::Server::Standalone::Prefork and
18 Plack::Server::Standalone::Prefork::Server::Starter.
19
20 The server supports following features, and is suitable for running
21 HTTP application servers behind a reverse proxy.
22
23 - prefork and graceful shutdown using Parallel::Prefork
24
25 - hot deploy using Server::Starter
26
27 - fast HTTP processing using HTTP::Parser::XS (optional)
28
30 In addition to the options supported by plackup, Starlet accepts
31 following options(s).
32
33 --max-workers=#
34 number of worker processes (default: 10)
35
36 --timeout=#
37 seconds until timeout (default: 300)
38
39 --keepalive-timeout=#
40 timeout for persistent connections (default: 2)
41
42 --max-keepalive-reqs=#
43 max. number of requests allowed per single persistent connection. If
44 set to one, persistent connections are disabled (default: 1)
45
46 --max-reqs-per-child=#
47 max. number of requests to be handled before a worker process exits
48 (default: 100)
49
50 --min-reqs-per-child=#
51 if set, randomizes the number of requests handled by a single worker
52 process between the value and that supplied by "--max-reqs-per-chlid"
53 (default: none)
54
55 --spawn-interval=#
56 if set, worker processes will not be spawned more than once than every
57 given seconds. Also, when SIGHUP is being received, no more than one
58 worker processes will be collected every given seconds. This feature
59 is useful for doing a "slow-restart". See
60 http://blog.kazuhooku.com/2011/04/web-serverstarter-parallelprefork.html
61 for more information. (default: none)
62
63 --child-exit=s
64 the subroutine code to be executed right before a child process exits.
65 e.g. "--child-exit='sub { POSIX::_exit(0) }'". (default: none)
66
68 psgix.informational
69 Starlets exposes a callback named "psgix.informational" that can be
70 used for sending an informational response. The callback accepts two
71 arguments, the first argument being the status code and the second
72 being an arrayref of the headers to be sent. Example below sends an
73 103 response before processing the request to build a final response.
74
75 sub {
76 my $env = shift;
77 $env["psgix.informational"}->(103, [
78 'link' => '</style.css>; rel=preload'
79 ]);
80 my $resp = ... application logic ...
81 $resp;
82 }
83
85 Starlet is designed and implemented to be simple, secure and fast,
86 especially for running as an HTTP application server running behind a
87 reverse proxy. It only depends on a minimal number of well-designed
88 (and well-focused) modules.
89
91 Parallel::Prefork Starman Server::Starter
92
94 Kazuho Oku
95
96 miyagawa
97
98 kazeburo
99
100 Tomohiro Takezawa
101
103 This program is free software; you can redistribute it and/or modify it
104 under the same terms as Perl itself.
105
106 See <http://www.perl.com/perl/misc/Artistic.html>
107
108
109
110perl v5.32.1 2021-01-27 Starlet(3)