Gazelle

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

# NAME

Gazelle - a Preforked Plack Handler for performance freaks

# SYNOPSIS

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

# DESCRIPTION

Gazelle is a PSGI Handler. It is derivied from [Starlet](https://metacpan.org/pod/Starlet).
A lot of its code was rewritten or optimized by converting it to XS code.

Gazelle supports following features:

- Supports HTTP/1.1. (Without Keepalive support.)
- Ultra fast HTTP processing using picohttpparser.
- Uses accept4(2) if the operating system supports it.
- Uses writev(2) for output responses.
- Prefork and graceful shutdown using Parallel::Prefork.
- Hot deploy and unix domain socket using Server::Starter.

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

One can find a Benchmark here:
[https://github.com/kazeburo/Gazelle/wiki/Benchmark](https://github.com/kazeburo/Gazelle/wiki/Benchmark) .

# 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 [Server::Starter](https://metacpan.org/pod/Server%3A%3AStarter)

# COMMAND LINE OPTIONS

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

## --max-workers=#

Number of worker processes (default: 10).

## --timeout=#

Seconds until timeout (default: 300).

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

Maximal number of requests to be handled before a worker process exits
(default: 1000).

## --min-reqs-per-child=#

If set, randomize the number of requests handled by a single worker process
between this value and the one supplied by `--max-reqs-per-child` (default:
none).



( run in 1.653 second using v1.01-cache-2.11-cpan-5a3173703d6 )