mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
107 lines
4.4 KiB
HTML
107 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Green Unicorn - FAQ</title>
|
|
<link rel="alternate" type="application/rss+xml" href="/feed.xml" />
|
|
|
|
<!--[if IE]>
|
|
<script>
|
|
document.createElement('section');
|
|
document.createElement('article');
|
|
document.createElement('aside');
|
|
document.createElement('footer');
|
|
document.createElement('header');
|
|
document.createElement('nav');
|
|
document.createElement('time');
|
|
</script>
|
|
|
|
<![endif]-->
|
|
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div id="header">
|
|
|
|
<h1 class="logo"><a href="http://gunicorn.org">gunicorn</a></h1>
|
|
|
|
<div id="links">
|
|
Get the source via
|
|
<a href="http://github.com/benoitc/gunicorn">git</a>, then
|
|
<a href="http://github.com/benoitc/gunicorn/issues">send feedback</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div id="menu">
|
|
<ul id="actions">
|
|
<li><a href="installation.html">Installation</a></li>
|
|
<li><a href="usage.html">Usage</a></li>
|
|
<li><a href="deployment.html">Deployment</a></li>
|
|
<li><a href="configuration.html">Configuration</a></li>
|
|
<li><a href="tuning.html">Tuning</a></li>
|
|
<li><a href="faq.html">FAQ</a></li>
|
|
<li><a href="news.html">News</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document" id="faq">
|
|
<h1 class="title">FAQ</h1>
|
|
<dl class="docutils">
|
|
<dt>How do I know which type of worker to use?</dt>
|
|
<dd>Test. Read the "Synchronous vs Asynchronous workers" section on the
|
|
<a class="reference external" href="http://gunicorn.org/deployment.html">deployment</a> page. Test some more.</dd>
|
|
<dt>What types of workers are there?</dt>
|
|
<dd><p class="first">These can all be used with the <tt class="docutils literal"><span class="pre">-k</span></tt> option and specifying them
|
|
as <tt class="docutils literal"><span class="pre">egg:gunicorn#$(NAME)</span></tt> where <tt class="docutils literal">$(NAME)</tt> is chosen from this list.</p>
|
|
<ul class="last simple">
|
|
<li><tt class="docutils literal">sync</tt> - The default synchronous worker</li>
|
|
<li><tt class="docutils literal">eventlet</tt> - Asynchronous workers based on Greenlets</li>
|
|
<li><tt class="docutils literal">gevent</tt> - Asynchronous workers based on Greenlets</li>
|
|
<li><tt class="docutils literal">tornado</tt> - Asynchronous workers based on FriendFeed's Tornado server.</li>
|
|
</ul>
|
|
</dd>
|
|
<dt>How might I test a proxy configuration?</dt>
|
|
<dd>Check out <a class="reference external" href="http://ha.ckers.org/slowloris/">slowloris</a> for a script that will generate significant slow
|
|
traffic. If your application remains responsive through out that test you
|
|
should be comfortable that all is well with your configuration.</dd>
|
|
<dt>How do I reload my application in Gunicorn?</dt>
|
|
<dd><p class="first">You can gracefully reload by sending HUP signal to gunicorn:</p>
|
|
<pre class="last literal-block">
|
|
$ kill -HUP masterpid
|
|
</pre>
|
|
</dd>
|
|
<dt>How do I increase or decrease the number of running workers dynamically?</dt>
|
|
<dd><p class="first">To increase the worker count by one:</p>
|
|
<pre class="literal-block">
|
|
$ kill -TTIN $masterpid
|
|
</pre>
|
|
<p>To decrease the worker count by one:</p>
|
|
<pre class="last literal-block">
|
|
$ kill -TTOU $masterpid
|
|
</pre>
|
|
</dd>
|
|
<dt>How can I figure out the best number of worker processes?</dt>
|
|
<dd>Start gunicorn with an approximate number of worker processes. Then use the
|
|
TTIN and/or TTOU signals to adjust the number of workers under load.</dd>
|
|
<dt>How do I set SCRIPT_NAME?</dt>
|
|
<dd>By default <tt class="docutils literal">SCRIPT_NAME</tt> is an empy string. The value could be set by
|
|
setting <tt class="docutils literal">SCRIPT_NAME</tt> in the environment or as an HTTP header.</dd>
|
|
<dt>How can I name processes?</dt>
|
|
<dd>You need to install the Python package <a class="reference external" href="http://pypi.python.org/pypi/setproctitle">setproctitle</a>. Then you can specify
|
|
a base process name on the command line (<tt class="docutils literal"><span class="pre">-n</span></tt>) or in the configuration
|
|
file.</dd>
|
|
</dl>
|
|
</div>
|
|
|
|
|
|
|
|
<div id="footer">
|
|
<p>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.</p>
|
|
<p>Hosted on <a href="http://github.com/">Github</a></p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |