Starman(3pm)

πŸ’… Starman (that's the Starman module, manual page Starman(3pm), bestie)

okay so picture this: a Perl web server that is fast, preforking, and honestly kind of iconic. That's Starman. She's a PSGI/Plack server and she's been eating since 2010. Let's get into it 🫢


✨ SYNOPSIS ✨

run your app with the default settings, no thoughts head empty:

# Run app.psgi with the default settings
> starman

now do it with Server::Starter, because hot deploys are a whole vibe:

# run with Server::Starter
> start_server --port 127.0.0.1:80 -- starman --workers 32 myapp.psgi

and if you're a UNIX domain socket girlie:

# UNIX domain sockets
> starman --listen /tmp/starman.sock

want more options and configs? just run perldoc starman β€” note the lower-case s, no cap, that's the other page, iykyk 😌


🌸 DESCRIPTION 🌸

Starman is a PSGI perl web server and she has some unique features, like:

High Performance

she uses the fast XS/C HTTP header parser. literally built different πŸ”₯

Preforking

spawns workers preforked, the way most high performance UNIX servers do. and like a good friend, Starman also reaps dead children and automatically restarts the worker pool. no drama, she just handles it πŸ’…

Signals

  • HUP β€” graceful worker restarts
  • TTIN / TTOU β€” dynamically increase or decrease the number of worker processes
  • QUIT β€” gracefully shut down the worker processes

Superdaemon aware

supports Server::Starter for hot deploy and graceful restarts. main character energy ✨

Multiple interfaces and UNIX Domain Socket support

able to listen on multiple interfaces including UNIX sockets. versatile queen πŸ‘‘

Small memory footprint

preloading the applications with the --preload-app command line option enables copy-on-write friendly memory management. also the minimum memory usage Starman requires for the master process is 7MB and children (workers) is less than 3.0MB. tiny but mighty 🧚

PSGI compatible

can run any PSGI applications and frameworks. no gatekeeping 🌈

HTTP/1.1 support

supports chunked requests and responses, keep-alive and pipeline requests. periodt.

UNIX only

🚨 this server does not support Win32. sorry windows besties, it's not happening πŸ’€

⚑ PERFORMANCE ⚑

here's a simple benchmark using Hello.psgi. the receipts:

-- server: Starman (workers=10)
Requests per second:    6849.16 [#/sec] (mean)
-- server: Twiggy
Requests per second:    3911.78 [#/sec] (mean)
-- server: AnyEvent::HTTPD
Requests per second:    2738.49 [#/sec] (mean)
-- server: HTTP::Server::PSGI
Requests per second:    2218.16 [#/sec] (mean)
-- server: HTTP::Server::PSGI (workers=10)
Requests per second:    2792.99 [#/sec] (mean)
-- server: HTTP::Server::Simple
Requests per second:    1435.50 [#/sec] (mean)
-- server: Corona
Requests per second:    2332.00 [#/sec] (mean)
-- server: POE
Requests per second:    503.59 [#/sec] (mean)

she ate and left absolutely no crumbs πŸ‘‘ that benchmark was processed with ab -c 10 -t 1 -k on a MacBook Pro 13" late 2009 model on Mac OS X 10.6.2 with perl 5.10.0. YMMV β€” your mileage may vary, so don't come for her if your numbers differ πŸ™ˆ


πŸ¦‹ NOTES πŸ¦‹

because Starman runs as a preforking model, it is not recommended to serve the requests directly from the internet, especially when slow requesting clients are taken into consideration. like, please don't. 😭

it's suggested to put Starman workers behind the frontend servers such as nginx, and use HTTP proxy with TCP or UNIX sockets. protect her at all costs 🫢

πŸ’– PSGI EXTENSIONS πŸ’–

psgix.informational

Starman exposes a callback named psgix.informational that can be used for sending an informational response. The callback accepts two arguments β€” the first argument being the status code and the second being an arrayref of the headers to be sent.

the example below sends an 103 Early Hints response before processing the request to build a final response. so extra of her:

sub {
    my $env = shift;

    $env->{'psgix.informational'}->( 103, [
        "Link" => "</style.css>; rel=preload"
    ] );

    my $rest = ...
    $resp;
}

πŸŽ€ AUTHOR πŸŽ€

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

Andy Grundman wrote Catalyst::Engine::HTTP::Prefork, which this module is heavily based on.

Kazuho Oku wrote Net::Server::SS::PreFork that makes it easy to add Server::Starter support to this software.

The psgix.informational callback comes from Starlet by Kazuho Oku. credit where credit is due, we love a collab 🌟


Tatsuhiko Miyagawa, 2010-


🌸 LICENSE 🌸

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source icon πŸ’œ


🐚 SEE ALSO 🐚

Plack Catalyst::Engine::HTTP::Prefork Net::Server::PreFork


and that's the whole page bestie, no cap πŸ’… this was perl v5.40.1, dated 2026-05-05 β€” go forth and serve some PSGI πŸ¦‹

πŸ“¦ where this page comes from