Permalink
Browse files

Merge branch 'master' of https://github.com/benoitc/gunicorn

Conflicts:
	gunicorn/app/djangoapp.py
  • Loading branch information...
2 parents b8ff9ec + 326356a commit 10632ac15ade28c829f7a8971f03108f58970a3d @rbdcti committed Jun 26, 2012
Showing with 1,513 additions and 497 deletions.
  1. +7 −0 .gitignore
  2. +9 −0 .travis.yml
  3. +0 −1 MANIFEST.in
  4. +15 −0 Makefile
  5. +6 −0 README.rst
  6. +5 −0 THANKS
  7. +65 −54 doc/htdocs/configure.html
  8. +25 −27 doc/htdocs/css/index.css
  9. +25 −27 doc/htdocs/css/style.css
  10. +18 −6 doc/htdocs/deploy.html
  11. +15 −8 doc/htdocs/index.html
  12. +15 −9 doc/htdocs/install.html
  13. +98 −61 doc/htdocs/news.html
  14. +6 −0 doc/htdocs/run.html
  15. +23 −0 doc/site/deploy.rst
  16. +18 −11 doc/site/install.rst
  17. +32 −0 doc/site/news.rst
  18. +7 −2 doc/site/run.rst
  19. +6 −0 examples/frameworks/django/testing/testing/wsgi.py
  20. +95 −0 examples/frameworks/pylonstest/development2.ini
  21. +1 −1 examples/frameworks/pylonstest/pylonstest/controllers/hello.py
  22. +1 −1 examples/supervisor.conf
  23. +0 −1 examples/test.py
  24. +343 −81 examples/websocket/gevent_websocket.py
  25. +341 −81 examples/websocket/websocket.py
  26. +1 −1 gunicorn/__init__.py
  27. +1 −6 gunicorn/app/base.py
  28. +7 −2 gunicorn/app/django_wsgi.py
  29. +11 −8 gunicorn/app/djangoapp.py
  30. +1 −0 gunicorn/app/pasterapp.py
  31. +13 −6 gunicorn/arbiter.py
  32. +26 −11 gunicorn/config.py
  33. +13 −7 gunicorn/glogging.py
  34. +9 −13 gunicorn/http/body.py
  35. +1 −1 gunicorn/http/errors.py
  36. +23 −13 gunicorn/http/message.py
  37. +11 −3 gunicorn/http/wsgi.py
  38. +4 −3 gunicorn/util.py
  39. +7 −2 gunicorn/workers/async.py
  40. +31 −12 gunicorn/workers/base.py
  41. +2 −2 gunicorn/workers/geventlet.py
  42. +3 −2 gunicorn/workers/ggevent.py
  43. +4 −2 gunicorn/workers/gtornado.py
  44. +5 −2 gunicorn/workers/sync.py
  45. +8 −4 tests/001-test-valid-requests.py
  46. +13 −3 tests/002-test-invalid-requests.py
  47. +61 −0 tests/004-test-http-body.py
  48. +1 −1 tests/requests/invalid/008.http
  49. +3 −0 tests/requests/invalid/010.http
  50. +6 −0 tests/requests/invalid/010.py
  51. +5 −0 tests/requests/invalid/011.http
  52. +6 −0 tests/requests/invalid/011.py
  53. +5 −0 tests/requests/invalid/012.http
  54. +6 −0 tests/requests/invalid/012.py
  55. +4 −0 tests/requests/invalid/013.http
  56. +6 −0 tests/requests/invalid/013.py
  57. +3 −0 tests/requests/valid/024.http
  58. +16 −0 tests/requests/valid/024.py
  59. +10 −22 tests/treq.py
  60. +11 −0 tox.ini
View
@@ -8,12 +8,19 @@ setuptools-*
.svn/*
.DS_Store
*.so
+.Python
distribute-0.6.8-py2.6.egg
distribute-0.6.8.tar.gz
gunicorn.egg-info
nohup.out
.coverage
doc/.sass-cache
+bin/
+lib/
+man/
+include/
+html/
examples/frameworks/pylonstest/PasteScript*
examples/frameworks/pylonstest/pylonstest.egg-info/
examples/frameworks/django/testing/testdb.sql
+.tox
View
@@ -0,0 +1,9 @@
+language: python
+
+python:
+ - 2.6
+ - 2.7
+ - pypy
+
+install: python setup.py install
+script: nosetests
View
@@ -6,5 +6,4 @@ include THANKS
recursive-include tests *
recursive-include examples *
recursive-include doc *
-recursive-include debian *
recursive-include examples/frameworks *
View
@@ -0,0 +1,15 @@
+build:
+ virtualenv --no-site-packages .
+ bin/python setup.py develop
+ bin/pip install coverage
+ bin/pip install nose
+
+test:
+ bin/nosetests
+
+coverage:
+ bin/nosetests --with-coverage --cover-html --cover-html-dir=html \
+ --cover-package=gunicorn
+
+clean:
+ @rm -rf .Python bin lib include man build html
View
@@ -8,6 +8,12 @@ resource usage, and fairly speedy.
Feel free to join us in `#gunicorn`_ on freenode_.
+.. image::
+ https://secure.travis-ci.org/benoitc/gunicorn.png?branch=master
+ :alt: Build Status
+ :target: https://secure.travis-ci.org/benoitc/gunicorn
+
+
Installation
------------
View
5 THANKS
@@ -38,3 +38,8 @@ Dan Callaghan <djc@djc.id.au>
Kristian Glass <git@doismellburning.co.uk>
Mazdak Rezvani <mazdak@mac.com>
Maxim Kamenkov <mkamenkov@gmail.com>
+Konstantin Kapustin <sirkonst@gmail.com>
+Djoume Salvetti <djoume@freshbooks.com>
+ZheFu Peng (CMGS) <ilskdw@gmail.com>
+Caleb Brown <git@calebbrown.id.au>
+Marc Abramowitz <marc@marc-abramowitz.com>
View
@@ -225,6 +225,17 @@
workers it just means that the worker process is still communicating and
is not tied to the length of time required to handle a single request.</p>
</div>
+<div class="section" id="graceful-timeout">
+<h4><a class="toc-backref" href="#contents">graceful_timeout</a></h4>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">--graceful-timeout</span> INT</tt></li>
+<li><tt class="docutils literal">30</tt></li>
+</ul>
+<p>Timeout for graceful workers restart.</p>
+<p>Generally set to thirty seconds. How max time worker can handle
+request after got restart signal. If the time is up worker will
+be force killed.</p>
+</div>
<div class="section" id="keepalive">
<h4><a class="toc-backref" href="#contents">keepalive</a></h4>
<ul class="simple">
@@ -250,8 +261,8 @@
restriction on the length of a request-URI allowed for a request
on the server. A server needs this value to be large enough to
hold any of its resource names, including any information that
-might be passed in the query part of a GET request. By default
-this value is 4094 and can't be larger than 8190.</p>
+might be passed in the query part of a GET request. Value is a number
+from 0 (unlimited) to 8190.</p>
<p>This parameter can be used to prevent any DDOS attack.</p>
</div>
<div class="section" id="limit-request-fields">
@@ -261,10 +272,10 @@
<li><tt class="docutils literal">100</tt></li>
</ul>
<p>Limit the number of HTTP headers fields in a request.</p>
-<p>Value is a number from 0 (unlimited) to 32768. This parameter is
-used to limit the number of headers in a request to prevent DDOS
-attack. Used with the <cite>limit_request_field_size</cite> it allows more
-safety.</p>
+<p>This parameter is used to limit the number of headers in a request to
+prevent DDOS attack. Used with the <cite>limit_request_field_size</cite> it allows
+more safety. By default this value is 100 and can't be larger than
+32768.</p>
</div>
<div class="section" id="limit-request-field-size">
<h4><a class="toc-backref" href="#contents">limit_request_field_size</a></h4>
@@ -344,7 +355,7 @@
<h4><a class="toc-backref" href="#contents">user</a></h4>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">-u</span> USER, <span class="pre">--user</span> USER</tt></li>
-<li><tt class="docutils literal">501</tt></li>
+<li><tt class="docutils literal">1000</tt></li>
</ul>
<p>Switch worker processes to run as this user.</p>
<p>A valid user id (as an integer) or the name of a user that can be
@@ -355,7 +366,7 @@
<h4><a class="toc-backref" href="#contents">group</a></h4>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">-g</span> GROUP, <span class="pre">--group</span> GROUP</tt></li>
-<li><tt class="docutils literal">20</tt></li>
+<li><tt class="docutils literal">1000</tt></li>
</ul>
<p>Switch worker process to run as this group.</p>
<p>A valid group id (as an integer) or the name of a user that can be
@@ -419,7 +430,7 @@
<li><tt class="docutils literal">None</tt></li>
</ul>
<p>The Access log file to write to.</p>
-<p>&quot;-&quot; means log to stdout.</p>
+<p>&quot;-&quot; means log to stderr.</p>
</div>
<div class="section" id="access-log-format">
<h4><a class="toc-backref" href="#contents">access_log_format</a></h4>
@@ -452,7 +463,7 @@
<li><tt class="docutils literal">-</tt></li>
</ul>
<p>The Error log file to write to.</p>
-<p>&quot;-&quot; means log to stdout.</p>
+<p>&quot;-&quot; means log to stderr.</p>
</div>
<div class="section" id="loglevel">
<h4><a class="toc-backref" href="#contents">loglevel</a></h4>
@@ -560,8 +571,7 @@
<ul>
<li><pre class="first literal-block">
def on_reload(server):
- for i in range(server.app.cfg.workers):
- server.spawn_worker()
+ pass
</pre>
</li>
</ul>
@@ -688,62 +698,63 @@
<li><a class="reference internal" href="#worker-connections" id="id15">worker_connections</a></li>
<li><a class="reference internal" href="#max-requests" id="id16">max_requests</a></li>
<li><a class="reference internal" href="#timeout" id="id17">timeout</a></li>
-<li><a class="reference internal" href="#keepalive" id="id18">keepalive</a></li>
+<li><a class="reference internal" href="#graceful-timeout" id="id18">graceful_timeout</a></li>
+<li><a class="reference internal" href="#keepalive" id="id19">keepalive</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#security" id="id19">Security</a><ul>
-<li><a class="reference internal" href="#limit-request-line" id="id20">limit_request_line</a></li>
-<li><a class="reference internal" href="#limit-request-fields" id="id21">limit_request_fields</a></li>
-<li><a class="reference internal" href="#limit-request-field-size" id="id22">limit_request_field_size</a></li>
+<li><a class="reference internal" href="#security" id="id20">Security</a><ul>
+<li><a class="reference internal" href="#limit-request-line" id="id21">limit_request_line</a></li>
+<li><a class="reference internal" href="#limit-request-fields" id="id22">limit_request_fields</a></li>
+<li><a class="reference internal" href="#limit-request-field-size" id="id23">limit_request_field_size</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#debugging" id="id23">Debugging</a><ul>
-<li><a class="reference internal" href="#debug" id="id24">debug</a></li>
-<li><a class="reference internal" href="#spew" id="id25">spew</a></li>
-<li><a class="reference internal" href="#check-config" id="id26">check_config</a></li>
+<li><a class="reference internal" href="#debugging" id="id24">Debugging</a><ul>
+<li><a class="reference internal" href="#debug" id="id25">debug</a></li>
+<li><a class="reference internal" href="#spew" id="id26">spew</a></li>
+<li><a class="reference internal" href="#check-config" id="id27">check_config</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#server-mechanics" id="id27">Server Mechanics</a><ul>
-<li><a class="reference internal" href="#preload-app" id="id28">preload_app</a></li>
-<li><a class="reference internal" href="#daemon" id="id29">daemon</a></li>
-<li><a class="reference internal" href="#pidfile" id="id30">pidfile</a></li>
-<li><a class="reference internal" href="#user" id="id31">user</a></li>
-<li><a class="reference internal" href="#group" id="id32">group</a></li>
-<li><a class="reference internal" href="#umask" id="id33">umask</a></li>
-<li><a class="reference internal" href="#tmp-upload-dir" id="id34">tmp_upload_dir</a></li>
-<li><a class="reference internal" href="#secure-scheme-headers" id="id35">secure_scheme_headers</a></li>
-<li><a class="reference internal" href="#x-forwarded-for-header" id="id36">x_forwarded_for_header</a></li>
+<li><a class="reference internal" href="#server-mechanics" id="id28">Server Mechanics</a><ul>
+<li><a class="reference internal" href="#preload-app" id="id29">preload_app</a></li>
+<li><a class="reference internal" href="#daemon" id="id30">daemon</a></li>
+<li><a class="reference internal" href="#pidfile" id="id31">pidfile</a></li>
+<li><a class="reference internal" href="#user" id="id32">user</a></li>
+<li><a class="reference internal" href="#group" id="id33">group</a></li>
+<li><a class="reference internal" href="#umask" id="id34">umask</a></li>
+<li><a class="reference internal" href="#tmp-upload-dir" id="id35">tmp_upload_dir</a></li>
+<li><a class="reference internal" href="#secure-scheme-headers" id="id36">secure_scheme_headers</a></li>
+<li><a class="reference internal" href="#x-forwarded-for-header" id="id37">x_forwarded_for_header</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#logging" id="id37">Logging</a><ul>
-<li><a class="reference internal" href="#accesslog" id="id38">accesslog</a></li>
-<li><a class="reference internal" href="#access-log-format" id="id39">access_log_format</a></li>
-<li><a class="reference internal" href="#errorlog" id="id40">errorlog</a></li>
-<li><a class="reference internal" href="#loglevel" id="id41">loglevel</a></li>
-<li><a class="reference internal" href="#logger-class" id="id42">logger_class</a></li>
-<li><a class="reference internal" href="#logconfig" id="id43">logconfig</a></li>
+<li><a class="reference internal" href="#logging" id="id38">Logging</a><ul>
+<li><a class="reference internal" href="#accesslog" id="id39">accesslog</a></li>
+<li><a class="reference internal" href="#access-log-format" id="id40">access_log_format</a></li>
+<li><a class="reference internal" href="#errorlog" id="id41">errorlog</a></li>
+<li><a class="reference internal" href="#loglevel" id="id42">loglevel</a></li>
+<li><a class="reference internal" href="#logger-class" id="id43">logger_class</a></li>
+<li><a class="reference internal" href="#logconfig" id="id44">logconfig</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#process-naming" id="id44">Process Naming</a><ul>
-<li><a class="reference internal" href="#proc-name" id="id45">proc_name</a></li>
-<li><a class="reference internal" href="#default-proc-name" id="id46">default_proc_name</a></li>
+<li><a class="reference internal" href="#process-naming" id="id45">Process Naming</a><ul>
+<li><a class="reference internal" href="#proc-name" id="id46">proc_name</a></li>
+<li><a class="reference internal" href="#default-proc-name" id="id47">default_proc_name</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#django" id="id47">Django</a><ul>
-<li><a class="reference internal" href="#django-settings" id="id48">django_settings</a></li>
-<li><a class="reference internal" href="#pythonpath" id="id49">pythonpath</a></li>
+<li><a class="reference internal" href="#django" id="id48">Django</a><ul>
+<li><a class="reference internal" href="#django-settings" id="id49">django_settings</a></li>
+<li><a class="reference internal" href="#pythonpath" id="id50">pythonpath</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#server-hooks" id="id50">Server Hooks</a><ul>
-<li><a class="reference internal" href="#on-starting" id="id51">on_starting</a></li>
-<li><a class="reference internal" href="#on-reload" id="id52">on_reload</a></li>
-<li><a class="reference internal" href="#when-ready" id="id53">when_ready</a></li>
-<li><a class="reference internal" href="#pre-fork" id="id54">pre_fork</a></li>
-<li><a class="reference internal" href="#post-fork" id="id55">post_fork</a></li>
-<li><a class="reference internal" href="#pre-exec" id="id56">pre_exec</a></li>
-<li><a class="reference internal" href="#pre-request" id="id57">pre_request</a></li>
-<li><a class="reference internal" href="#post-request" id="id58">post_request</a></li>
-<li><a class="reference internal" href="#worker-exit" id="id59">worker_exit</a></li>
+<li><a class="reference internal" href="#server-hooks" id="id51">Server Hooks</a><ul>
+<li><a class="reference internal" href="#on-starting" id="id52">on_starting</a></li>
+<li><a class="reference internal" href="#on-reload" id="id53">on_reload</a></li>
+<li><a class="reference internal" href="#when-ready" id="id54">when_ready</a></li>
+<li><a class="reference internal" href="#pre-fork" id="id55">pre_fork</a></li>
+<li><a class="reference internal" href="#post-fork" id="id56">post_fork</a></li>
+<li><a class="reference internal" href="#pre-exec" id="id57">pre_exec</a></li>
+<li><a class="reference internal" href="#pre-request" id="id58">pre_request</a></li>
+<li><a class="reference internal" href="#post-request" id="id59">post_request</a></li>
+<li><a class="reference internal" href="#worker-exit" id="id60">worker_exit</a></li>
</ul>
</li>
</ul>
Oops, something went wrong.

0 comments on commit 10632ac

Please sign in to comment.