190 Commits

Author SHA1 Message Date
Alexis Le-Quoc
05051aa8b2 Simpler statsd integration
No need to specify a logger class.
--statsd-to is enough to trigger the Statsd logger automatically
2014-06-18 21:33:04 -04:00
Alexis Le-Quoc
c3421a833d Merge branch 'master' of https://github.com/benoitc/gunicorn into statsd-logger 2014-06-18 11:23:36 -04:00
Andrew Burdo
ed2d2a8ab3 Change the rest of QUIT and TERM signals.
This will restore graceful shutdown of workers by master.
Also worker_int callback is moved from handle_exit (INT and TERM before switching) to handle_quit(INT and QUIT).
2014-06-13 14:32:11 +03:00
Randall Leeds
ae14150cad Merge pull request #727 from benoitc/feature/threaded-worker
Feature/threaded worker
2014-06-01 14:16:44 -07:00
benoitc
d9b7e32d34 try to log what happened in the worker after a timeout.
fix #518
2014-06-01 11:22:19 +02:00
Ben Oswald
9ade14ae78 add on_exit hook 2014-06-01 09:53:36 +02:00
benoitc
b810a1d1a9 fix doc 2014-05-31 07:13:36 +02:00
Alexis Le-Quoc
de9b05c774 Merge branch 'master' of https://github.com/benoitc/gunicorn into statsd-logger 2014-05-30 23:10:35 -04:00
benoitc
7f9d745eb5 reuse asyncio code in the threaded worker 2014-05-30 11:07:35 +02:00
Berker Peksag
ecdae40c68 Sync settings documentation with gunicorn/config.py. 2014-05-18 03:01:18 +03:00
Berker Peksag
39dbe983c3 Fix markup of the access_log_format documentation. 2014-05-18 02:02:33 +03:00
Yue Du
f1fc2710f8 Remove unused imports 2014-05-14 19:52:48 +02:00
Yue Du
e6b696b6f0 Fix: logger_class can be undefined. 2014-05-14 19:52:48 +02:00
Yue Du
cb817dfa98 Remove unused imports 2014-05-14 14:08:18 +08:00
benoitc
6aa99e4441 fix keepalive 2014-05-13 12:30:57 +02:00
Yue Du
9e0d04b562 Fix: logger_class can be undefined. 2014-05-13 14:06:36 +08:00
Alexis Le-Quoc
8a3a3fcfa3 Merge branch 'master' of https://github.com/benoitc/gunicorn into statsd-logger 2014-05-12 17:51:02 +02:00
Yue Du
288a7b6427 Remove obsolete function sorter 2014-05-09 18:11:02 +08:00
Alexis Le-Quoc
0b5cc1e293 First cut of logger-based statsd 2014-05-05 15:50:13 -07:00
Stephen Holsapple
c353828351 Define Ciphers config conditionally
We only expose the `Ciphers` config parameter in versions of Python that
support it (i.e., >= Python 2.7).
2014-04-22 12:21:01 -07:00
Stephen Holsapple
cdca314298 Remove incompatible SSL option in Python 2.6
An exposed SSL option, `ciphers`, was added in Python 2.7 and breaks older
versions of Python with an unexpected kwargs error.

I'm not sure if this is the best way to fix this, and I'm happy to consider
other approachs. Some things I'm a bit up in the air about are:

  i) This is only broken for Python 2.6 and older whose ssl module doesn't
  expose this. Do the other types of workers not use ssl module, and thus might
  be able to make use of the `cipher` kwarg?

  ii) Should we silently or explicity fail? I couldn't find a nice way to do
  this because the configuration setting has a default value and resulted in
  stringy code to special case the one setting`.

What I would really like to do would add a "python_version" validator that
could intelligently handle this, but I went off into the weeds figuring out
how the SettingsMeta class works. :)
2014-04-14 15:59:03 -07:00
benoitc
7349c4fb9a add --threads param 2014-03-30 15:27:53 +02:00
benoitc
1e8b375038 fix doc and make sure we get the --paste option 2014-03-09 07:28:46 -07:00
Randall Leeds
e5442332fe Support running specific paster apps from .ini
Close #400
2014-03-08 18:16:03 -08:00
Randall Leeds
6f1d3362c5 Merge pull request #686 from benoitc/web-concurrency
Honor $WEB_CONCURRENCY environment variable.
2014-02-20 02:17:00 -08:00
Randall Leeds
2b3f63601b Add documentation for WEB_CONCURRENCY 2014-02-14 15:12:21 -08:00
W. Trevor King
2277901a72 Deprecate the --debug setting
"Limits the number of worker processes to 1" hasn't been true since
06a4dc6 (fix one error in gunicorn_paster, global conf was ignored,
2010-06-22), although it was true when the line was added in 3c7d532
(Large refactor of the documentation and website, 2010-05-22).

"changes some error handling that's sent to clients" hasn't been true
since feb86d3 (don't display the traceback in the HTTP response,
2013-09-27).

The only remaining actions that --debug had were disabling --preload
and hiding debug-level config logging.  The former seems useless (just
disable --preload directly) and the latter at doesn't seem useful
enough for a new setting (just turn down --log-level).  With this
commit, --preload always works and you always get debug-level config
logging.

I left a stub Debug entry in gunicorn.config, which we can leave in
place while folks convert any gunicorn scripts and configurations to
drop --debug.  When the time comes, we can just remove that entry.  I
also the boolean-config tests to use --preload, since that will still
be around after we remove the dummy Debug entry.

Fixes #700.
2014-02-13 12:40:41 -08:00
Berker Peksag
1e48a4071a Fix a typo.
environement -> environment
2014-02-10 21:21:03 +02:00
Kenneth Reitz
64144c732f Use $WEB_CONCURRENCY environment variable for default workers value 2014-02-06 11:44:52 -08:00
Trey Long
dbf6c76ac1 fixes issue #691, raw_env config file parsing 2014-02-05 19:07:35 -05:00
Randall Leeds
5d13659f0e Documentation formatting 2014-01-30 16:49:47 -08:00
Kenneth Reitz
a8ce74b29b Honor $WEB_CONCURRENCY environment variable.
Allows for changing concurrency configuration without changing
application code. This is an environment variable that other
communities (e.g. Rails) are starting to follow, and have enjoyed for a
little while now.

Have discussed with /cc @benoitc in the past and he was +1
2014-01-30 12:14:18 -05:00
Randall Leeds
e41e920a7c Add note about paste and preload for reloader 2014-01-29 14:34:00 -08:00
Randall Leeds
e106bf82a8 Add --reload option for code reloading
Fix #526
2014-01-15 19:08:34 -08:00
benoitc
24bfae8508 allows possibility to set the driver used in syslog for unix sockets
This changes allows a use to set the driver used to send the data over a
unix socket. 'dgram' for a dgram driver or 'stream' for a stream driver.
'stream' is the default. The change is documented in the settings
documentation.

fix #671
2014-01-01 14:53:45 +01:00
benoitc
a3e7b68119 make it explicit that we only send gunicorn logs to syslog.
follows suggestion in #548
2014-01-01 14:53:45 +01:00
benoitc
a0ccfa0c4f modify log_file option
Gunicorn should generally only bother writing its own log and let
the application handle the way it want to log its own errors.

Now the log_file option will be overriden by the gunicorn options
`--error-logfile` and `--access-logfile` if they are given.
2014-01-01 14:53:40 +01:00
benoitc
c487368129 fix the correct remote address
The remote address should return the direct client addr not a forwarded
header.

This is a breaking change. The main problem with such changes is the way
the application or framework will handle the URL completion. Indeed most
of them are only expecting a TCP socket.

fix #633
2013-12-27 16:18:21 +01:00
benoitc
776f315e41 fix whitespaces 2013-12-27 15:39:33 +01:00
Dariusz Suchojad
5fb61cb841 Added support for more options to ssl.wrap_socket 2013-12-26 14:21:38 +01:00
benoitc
28d6d4be42 add missing cli = --x-forwarded-for-hdr option 2013-12-26 14:14:30 +01:00
Benoit Chesneau
824b540fcb Merge pull request #642 from georgexsh/forward_ips_cli
set ForwardedAllowIPS via cli
2013-12-26 04:59:17 -08:00
benoitc
26a2e104cf fix typo 2013-12-26 13:54:35 +01:00
Raphaël Slinckx
f1e2073047 Make WorkerTmp accept a configurable tmp dir 2013-12-26 13:47:34 +01:00
Benoit Chesneau
9667cc6f7f Merge pull request #666 from ipetrov/correct_docs
Small changes at docs
2013-12-26 04:19:09 -08:00
benoitc
95efe1b7d2 add worker_int callback
fix #516
2013-12-26 12:26:07 +01:00
Benoit Chesneau
5625dbcfcd Merge pull request #667 from spladug/proxy-protocol-allow-star
proxy_allow_ips: Allow proxy protocol if "*" specified.
2013-12-26 02:57:47 -08:00
benoitc
a397d90774 don't depend on entry point for internal classes.
We don't have to depend on entry points when loading suppoorted workers
nad extensions, instead use the absolute path to load the class.

fix #259
2013-12-26 11:33:05 +01:00
Neil Williams
9d9e547316 proxy_allow_ips: Allow proxy protocol if "*" specified.
This makes proxy_allow_ips symmetrical with forwarded_allow_ips and is
useful in the same situations.
2013-12-17 13:48:27 -08:00
Igor Petrov
708bb840a1 Split access_log_format specifiers description into multiply lines
Correct sphinx-build error: source/settings.rst:762: ERROR: Inconsistent literal block quoting.
2013-12-14 01:43:16 +04:00