NAME

feersum - feersum app loader

SYNOPSIS

feersum [plackup opts] [--pre-fork=N] [app.psgi]
feersum --native [--listen host:port] [--pre-fork=N] [app.feersum]

DESCRIPTION

Loads the specified app file into a Feersum server.

In both cases, if --pre-fork=N is specified, that many worker processes are used to serve requests. See Feersum::Runner for details.

If in native mode (when running feersum --native), the following options are available:

--listen host:port

Address to listen on. Default is localhost:5000. May be given multiple times to listen on several addresses at once. IPv6 addresses should use bracket notation: --listen [::1]:5000. Note: IPv6 requires --reuseport mode; see Feersum::Runner for details.

--pre-fork=N

Fork N worker processes to handle requests.

--preload-app / --no-preload-app

Controls whether the app is loaded before forking workers (the default) or independently in each worker (--no-preload-app). Only meaningful with --pre-fork.

--hot-restart

Enable generation-based hot restart: the entry process becomes a supervisor and SIGHUP forks a fresh generation (clean module reload) before retiring the old one. See "hot_restart" in Feersum::Runner.

--max-requests-per-worker=N

Recycle a worker after it has served N requests (0, the default, means unlimited). Only effective with --pre-fork or --hot-restart.

--graceful-timeout=N

Seconds to wait for in-flight requests during graceful shutdown before force-exiting (default: 5).

--startup-timeout=N

Seconds to wait for a hot-restart generation to become ready before rolling back to the previous generation (default: 10).

--backlog=N

Listen socket backlog size (default: SOMAXCONN).

--daemonize

Fork into the background, detach from the terminal, and redirect standard streams to /dev/null.

--pid-file=FILE

Write the server PID to FILE (removed on clean shutdown). With --daemonize, contains the daemon's PID.

--user=USER / --group=GROUP

Drop privileges to this user/group after binding listen sockets. Allows binding privileged ports as root.

--verbose

Enable verbose output.

--reuseport

Enable SO_REUSEPORT for better load distribution across workers.

--epoll-exclusive

Enable EPOLLEXCLUSIVE mode (Linux 4.5+) for exclusive wakeup of workers.

--read-priority=N

Set EV priority for read events (-2 to 2).

--write-priority=N

Set EV priority for write events (-2 to 2).

--accept-priority=N

Set EV priority for accept events (-2 to 2).

--keepalive / --no-keepalive

Enable or disable HTTP keep-alive connections.

--read-timeout=N

Set read/keep-alive timeout in seconds (can be fractional). Must be positive (non-zero); the default is 5 seconds.

--max-connection-reqs=N

Maximum requests per keep-alive connection (0 for unlimited).

--max-accept-per-loop=N

Maximum connections to accept per event loop iteration (default: 64).

--max-connections=N

Maximum concurrent connections (default: 10000; 0 for unlimited). Provides DoS protection.

--max-read-buf=N

Maximum read buffer size per connection (default: 64 MB). This limits how large the read buffer can grow during header parsing and chunked body reception.

--max-body-len=N

Maximum request body size (default: 64 MB). This limits Content-Length values and cumulative chunked body sizes.

--max-uri-len=N

Maximum request URI length (default: 8192).

--wbuf-low-water=N

Write-buffer low-water mark in bytes (default: 0). Used with poll_cb() on streaming responses: the callback fires when the buffer drains to or below this threshold.

--psgix-io / --no-psgix-io

Enable or disable the psgix.io PSGI extension (default: enabled). Disabling skips per-request raw-handle setup if the app never uses WebSocket upgrades or raw I/O.

--max-h2-concurrent-streams=N

Maximum concurrent HTTP/2 streams per connection (default: 100, which is also the compile-time ceiling). Requires H2 support compiled in.

--header-timeout=N

Timeout in seconds for receiving complete HTTP headers (can be fractional). This is separate from the general read timeout. Default is 10 seconds; 0 disables it.

--write-timeout=N

Timeout in seconds for writing a response to a slow client (can be fractional). 0 (the default) disables the write timeout.

--reverse-proxy / --no-reverse-proxy

Enable or disable reverse proxy mode. When enabled, Feersum trusts X-Forwarded-For and X-Forwarded-Proto headers to determine the client IP address and URL scheme respectively.

--proxy-protocol / --no-proxy-protocol

Enable or disable PROXY protocol support (HAProxy protocol). When enabled, each new connection must begin with a PROXY protocol v1 or v2 header before any HTTP or TLS data. Works with both plain HTTP and TLS listeners.

--tls-cert-file=FILE

Path to the TLS certificate file (PEM format). Must be used together with --tls-key-file. Enables TLS 1.3 on all listeners.

SNI virtual hosting (multiple certificates per listener) is not available from the command line; use Feersum::Runner directly with its sni option.

--tls-key-file=FILE

Path to the TLS private key file (PEM format). Must be used together with --tls-cert-file.

--h2

Enable HTTP/2 negotiation via ALPN on TLS listeners. Requires TLS to be enabled (--tls-cert-file and --tls-key-file). H2 is off by default.

When running in PSGI mode (non-native), Plack::Runner is used. See that module for documentation and defaults.