# HG changeset patch # User Marcin Kuzminski # Date 2013-06-29 20:47:26 # Node ID ef252630aad8ce2af1d520f01b804f3233ac278f # Parent b1d2d5a16a7c1b271ad9c1193d6c5d2b51540b8f config: added example uwsgi configuration with auto-scaling workers mode. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -63,6 +63,58 @@ max_request_body_size = 107374182400 ## restarted #timeout = 3600 +## UWSGI ## +## run with uwsgi --ini-paste-logged +#[uwsgi] +#socket = /tmp/uwsgi.sock +#master = true +#http = 0.0.0.0:5000 + +## set as deamon and redirect all output to file +#daemonize = ./uwsgi_rhodecode.log + +## master process PID +#pidfile = ./uwsgi_rhodecode.pid + +## stats server with workers statistics, use uwsgitop +## for monitoring, `uwsgitop 127.0.0.1:1717` +#stats = 127.0.0.1:1717 + +## log 5XX errors +#log-5xx = true + +## Set the socket listen queue size. +#listen = 256 + +## Gracefully Reload workers after the specified amount of managed requests +## (avoid memory leaks). +#max-requests = 1000 + +## Log requests slower than the specified number of milliseconds. +#log-slow = 10 + +## Exit if no app can be loaded. +#need-app = true + +## Set lazy mode (load apps in workers instead of master). +#lazy = true + +## scaling ## +## set cheaper algorithm to use, if not set default will be used +#cheaper-algo = spare + +# minimum number of workers to keep at all times +#cheaper = 1 + +# number of workers to spawn at startup +#cheaper-initial = 1 + +# maximum number of workers that can be spawned +#workers = 4 + +# how many workers should be spawned at a time +#cheaper-step = 1 + ## COMMON ## host = 0.0.0.0 port = 5000 @@ -130,7 +182,7 @@ show_sha_length = 12 show_revision_number = true ## gist URL alias, used to create nicer urls for gist. This should be an -## url that does rewrites to _admin/gists/. +## url that does rewrites to _admin/gists/. ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/ gist_alias_url = @@ -140,7 +192,12 @@ gist_alias_url = ## api access to raw_files put `FilesController:raw`, to enable access to patches ## add `ChangesetController:changeset_patch`. This list should be "," separated ## Syntax is :. Check debug logs for generated names +## Recommended settings bellow are commented out: api_access_controllers_whitelist = +# ChangesetController:changeset_patch, +# ChangesetController:changeset_raw, +# FilesController:raw, +# FilesController:archivefile ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -208,7 +265,7 @@ issue_prefix = # ## a prefix key for this instance used for cache invalidation when running ## multiple instances of rhodecode, make sure it's globally unique for ## all running rhodecode instances. Leave empty if you don't use it -instance_id = +instance_id = ## alternative return HTTP header for failed authentication. Default HTTP ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with @@ -305,7 +362,7 @@ beaker.cache.sql_cache_long.key_length = #beaker.session.type = file beaker.session.key = rhodecode -beaker.session.secret = ${app_instance_uuid} +beaker.session.secret = develop-rc-uytcxaz ## Secure encrypted cookie. Requires AES and AES python libraries ## you must disable beaker.session.secret to use this @@ -425,8 +482,9 @@ logview.pylons.util = #eee ######################################################### ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### ######################################################### -#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db -sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode +#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 +sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode +#sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode sqlalchemy.db1.echo = false sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.db1.convert_unicode = true diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -63,6 +63,58 @@ max_request_body_size = 107374182400 ## restarted #timeout = 3600 +## UWSGI ## +## run with uwsgi --ini-paste-logged +#[uwsgi] +#socket = /tmp/uwsgi.sock +#master = true +#http = 127.0.0.1:5000 + +## set as deamon and redirect all output to file +#daemonize = ./uwsgi_rhodecode.log + +## master process PID +#pidfile = ./uwsgi_rhodecode.pid + +## stats server with workers statistics, use uwsgitop +## for monitoring, `uwsgitop 127.0.0.1:1717` +#stats = 127.0.0.1:1717 + +## log 5XX errors +#log-5xx = true + +## Set the socket listen queue size. +#listen = 256 + +## Gracefully Reload workers after the specified amount of managed requests +## (avoid memory leaks). +#max-requests = 1000 + +## Log requests slower than the specified number of milliseconds. +#log-slow = 10 + +## Exit if no app can be loaded. +#need-app = true + +## Set lazy mode (load apps in workers instead of master). +#lazy = true + +## scaling ## +## set cheaper algorithm to use, if not set default will be used +#cheaper-algo = spare + +# minimum number of workers to keep at all times +#cheaper = 1 + +# number of workers to spawn at startup +#cheaper-initial = 1 + +# maximum number of workers that can be spawned +#workers = 4 + +# how many workers should be spawned at a time +#cheaper-step = 1 + ## COMMON ## host = 127.0.0.1 port = 5000 @@ -130,7 +182,7 @@ show_sha_length = 12 show_revision_number = true ## gist URL alias, used to create nicer urls for gist. This should be an -## url that does rewrites to _admin/gists/. +## url that does rewrites to _admin/gists/. ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/ gist_alias_url = @@ -140,7 +192,12 @@ gist_alias_url = ## api access to raw_files put `FilesController:raw`, to enable access to patches ## add `ChangesetController:changeset_patch`. This list should be "," separated ## Syntax is :. Check debug logs for generated names +## Recommended settings bellow are commented out: api_access_controllers_whitelist = +# ChangesetController:changeset_patch, +# ChangesetController:changeset_raw, +# FilesController:raw, +# FilesController:archivefile ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -208,7 +265,7 @@ issue_prefix = # ## a prefix key for this instance used for cache invalidation when running ## multiple instances of rhodecode, make sure it's globally unique for ## all running rhodecode instances. Leave empty if you don't use it -instance_id = +instance_id = ## alternative return HTTP header for failed authentication. Default HTTP ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with @@ -305,7 +362,7 @@ beaker.cache.sql_cache_long.key_length = #beaker.session.type = file beaker.session.key = rhodecode -beaker.session.secret = ${app_instance_uuid} +beaker.session.secret = production-rc-uytcxaz ## Secure encrypted cookie. Requires AES and AES python libraries ## you must disable beaker.session.secret to use this @@ -425,8 +482,9 @@ logview.pylons.util = #eee ######################################################### ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### ######################################################### -#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db -sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode +#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 +sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode +#sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode sqlalchemy.db1.echo = false sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.db1.convert_unicode = true diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -63,6 +63,58 @@ max_request_body_size = 107374182400 ## restarted #timeout = 3600 +## UWSGI ## +## run with uwsgi --ini-paste-logged +#[uwsgi] +#socket = /tmp/uwsgi.sock +#master = true +#http = 127.0.0.1:5000 + +## set as deamon and redirect all output to file +#daemonize = ./uwsgi_rhodecode.log + +## master process PID +#pidfile = ./uwsgi_rhodecode.pid + +## stats server with workers statistics, use uwsgitop +## for monitoring, `uwsgitop 127.0.0.1:1717` +#stats = 127.0.0.1:1717 + +## log 5XX errors +#log-5xx = true + +## Set the socket listen queue size. +#listen = 256 + +## Gracefully Reload workers after the specified amount of managed requests +## (avoid memory leaks). +#max-requests = 1000 + +## Log requests slower than the specified number of milliseconds. +#log-slow = 10 + +## Exit if no app can be loaded. +#need-app = true + +## Set lazy mode (load apps in workers instead of master). +#lazy = true + +## scaling ## +## set cheaper algorithm to use, if not set default will be used +#cheaper-algo = spare + +# minimum number of workers to keep at all times +#cheaper = 1 + +# number of workers to spawn at startup +#cheaper-initial = 1 + +# maximum number of workers that can be spawned +#workers = 4 + +# how many workers should be spawned at a time +#cheaper-step = 1 + ## COMMON ## host = 127.0.0.1 port = 5000 @@ -130,7 +182,7 @@ show_sha_length = 12 show_revision_number = true ## gist URL alias, used to create nicer urls for gist. This should be an -## url that does rewrites to _admin/gists/. +## url that does rewrites to _admin/gists/. ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/ gist_alias_url = @@ -140,7 +192,12 @@ gist_alias_url = ## api access to raw_files put `FilesController:raw`, to enable access to patches ## add `ChangesetController:changeset_patch`. This list should be "," separated ## Syntax is :. Check debug logs for generated names +## Recommended settings bellow are commented out: api_access_controllers_whitelist = +# ChangesetController:changeset_patch, +# ChangesetController:changeset_raw, +# FilesController:raw, +# FilesController:archivefile ## alternative_gravatar_url allows you to use your own avatar server application ## the following parts of the URL will be replaced @@ -208,7 +265,7 @@ issue_prefix = # ## a prefix key for this instance used for cache invalidation when running ## multiple instances of rhodecode, make sure it's globally unique for ## all running rhodecode instances. Leave empty if you don't use it -instance_id = +instance_id = ## alternative return HTTP header for failed authentication. Default HTTP ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with @@ -427,7 +484,7 @@ logview.pylons.util = #eee ######################################################### # SQLITE [default] -sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db +sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 # POSTGRESQL # sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode