Giter VIP home page Giter VIP logo

gazelle's Introduction

NAME

Gazelle - 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's created based on Starlet code. Many code was rewritten and optimized by XS.

Gazelle supports following features.

- only supports HTTP/1.0. But does not support Keepalive.

- ultra fast HTTP processing using picohttpparser

- uses accept4(2) if OS support

- 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 like nginx.

Benchmark is here. 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

COMMAND LINE OPTIONS

In addition to the options supported by plackup, Gazelle accepts following options(s).

--max-workers=#

number of worker processes (default: 10)

--timeout=#

seconds until timeout (default: 300)

--max-reqs-per-child=#

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

--min-reqs-per-child=#

if set, randomizes the number of requests handled by a single worker process between the value and that supplied by --max-reqs-per-chlid (default: none)

--spawn-interval=#

if set, worker processes will not be spawned more than once than every given seconds. Also, when SIGHUP is being received, no more than one worker processes will be collected every given seconds. This feature is useful for doing a "slow-restart". See http://blog.kazuhooku.com/2011/04/web-serverstarter-parallelprefork.html for more information. (default: none)

SEE ALSO

Starlet Parallel::Prefork Server::Starter https://github.com/h2o/picohttpparser

LICENSE of Starlet

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

LICENSE

Copyright (C) Masahiro Nagano.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Masahiro Nagano [email protected]

gazelle's People

Contributors

kazeburo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.