The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojo::Server::Elzar - A windows multithreaded production web server

SYNOPSIS

  use Mojo::Server::Elzar;

  my $elzar = Mojo::Server::Elzar->new;
  $elzar->run('/home/me/myapp.pl');

DESCRIPTION

Mojo::Server::Elzar is a multithreaded alternative for Mojo::Server::Hypnotoad which is not available under Win32. It is designed to work as far as possible like Mojo::Server::Hypnotoad and will even use existing hypnotoad configuration entries.

The differences will be listed in this document.

To start applications with it you can use the elzar script, which listens on port 8080 and defaults to production mode for Mojolicious and Mojolicious::Lite applications.

  > elzar ./myapp.pl

You can run the same command again for automatic hot deployment.

  > elzar ./myapp.pl
  Starting hot deployment for Elzar server 31841.

This second invocation will load the application again, detect the process id file with it, and send a "DEPLOY" command to the already running server.

See "DEPLOYMENT" in Mojolicious::Guides::Cookbook for more.

Running as Windows Service

You can install elzar as Windows service. This has an additional dependency on the module Win32::Daemon. To install use:

  > elzar -i MyService ./myapp.pl

This will install a manually startable service under the local system account. The user should of course be changed to a lesser privileged account.

Hot deploy can be triggered as usual by doing:

  > elzar ./myapp.pl

or by pausing the service via Service Control (Computer Management). Pausing the service will only start the hot deploy but will not pause processing. Service Control will state that it couldn't pause the service.

MANAGER SIGNALS

The Mojo::Server::Elzar manager process can be controlled at runtime with the following signals.

INT, TERM

Shut down server immediately.

QUIT

Shut down server gracefully.

SETTINGS

Mojo::Server::Elzar can be configured with the same settings as Mojo::Server::Hypnotoad.

METHODS

Mojo::Server::Elzar implements the same methods as Mojo::Server::Hypnotoad.

MANAGER COMMANDS

Mojo::Server::Elzar can be controlled by the same commands as Mojo::Server::Threaded. For example to decrease the amount of workers by 2:

  $ elzar ./myapp.pl -c "WORKERS -2"
  Sent command 'WORKERS -2'!

CAVEATS

Mojo::Server::Elzar is new and should not be considered ready for production yet. Please report any issues on github https://github.com/tomk3003/mojo-server-threaded/issues

SEE ALSO

Mojolicious, Mojolicious::Guides, https://mojolicious.org.