Gazelle

 view release on metacpan or  search on metacpan

lib/Gazelle.pm  view on Meta::CPAN

package Gazelle;

use 5.008001;
use strict;
use warnings;

our $VERSION = "0.50";

1;

__END__

=encoding utf-8

=head1 NAME

Gazelle - a Preforked Plack Handler for performance freaks

=head1 SYNOPSIS

    $ plackup -s Gazelle --port 5003 --max-reqs-per-child 50000 \
         -E production -a app.psgi

=head1 DESCRIPTION

Gazelle is a PSGI Handler. It is derivied from L<Starlet>.
A lot of its code was rewritten or optimized by converting it to XS code.

Gazelle supports following features:

=over

=item * Supports HTTP/1.1. (Without Keepalive support.)

=item * Ultra fast HTTP processing using picohttpparser.

=item * Uses accept4(2) if the operating system supports it.

=item * Uses writev(2) for output responses.

=item * Prefork and graceful shutdown using Parallel::Prefork.

=item * Hot deploy and unix domain socket using Server::Starter.

=back

Gazelle is suitable for running HTTP application servers behind a reverse proxy
such as nginx.

One can find a Benchmark here:
L<https://github.com/kazeburo/Gazelle/wiki/Benchmark> .

=head1 SAMPLE CONFIGURATION WITH NGINX

nginx.conf:

  http {
    upstream app {
      server unix:/path/to/app.sock;
    }
    server {
      location / {
        proxy_pass http://app;
      }
      location ~ ^/(stylesheets|images)/ {
        root /path/to/webapp/public;
      }
    }
  }

command line of running Gazelle

  $ start_server --path /path/to/app.sock --backlog 16384 -- plackup -s Gazelle \
    -workers=20 --max-reqs-per-child 1000 --min-reqs-per-child 800 -E production -a app.psgi

start_server is bundled with L<Server::Starter>

=head1 COMMAND LINE OPTIONS

In addition to the options supported by plackup, Gazelle accepts the
following options:

=head2 --max-workers=#

Number of worker processes (default: 10).

=head2 --timeout=#

Seconds until timeout (default: 300).

=head2 --max-reqs-per-child=#

Maximal number of requests to be handled before a worker process exits



( run in 2.117 seconds using v1.01-cache-2.11-cpan-524268b4103 )