Commit adf25087 by John Jarvis

settings max-requests

parent 08b3aa92
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
EDXAPP_LMS_BASE: "" EDXAPP_LMS_BASE: ""
EDXAPP_PREVIEW_LMS_BASE: "" EDXAPP_PREVIEW_LMS_BASE: ""
EDXAPP_CMS_BASE: "" EDXAPP_CMS_BASE: ""
# Set this to the maximum number
# of requests for gunicorn for the lms and cms
# gunicorn --max-requests <num>
EDXAPP_LMS_MAX_REQ: !!null
EDXAPP_CMS_MAX_REQ: !!null
# 'None' will be written out as null in # 'None' will be written out as null in
# the configuration on disk # the configuration on disk
EDXAPP_AWS_ACCESS_KEY_ID: "None" EDXAPP_AWS_ACCESS_KEY_ID: "None"
...@@ -396,7 +402,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth ...@@ -396,7 +402,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth
MODULESTORE: MODULESTORE:
default: default:
ENGINE: 'xmodule.modulestore.mixed.MixedModuleStore' ENGINE: 'xmodule.modulestore.mixed.MixedModuleStore'
OPTIONS: OPTIONS:
mappings: $EDXAPP_XML_MAPPINGS mappings: $EDXAPP_XML_MAPPINGS
stores: stores:
- &edxapp_generic_draft_modulestore - &edxapp_generic_draft_modulestore
...@@ -570,7 +576,7 @@ cms_auth_config: ...@@ -570,7 +576,7 @@ cms_auth_config:
MODULESTORE: MODULESTORE:
default: default:
ENGINE: 'xmodule.modulestore.mixed.MixedModuleStore' ENGINE: 'xmodule.modulestore.mixed.MixedModuleStore'
OPTIONS: OPTIONS:
# See commented section below. LMS-11258 # See commented section below. LMS-11258
# mappings: $EDXAPP_XML_MAPPINGS # mappings: $EDXAPP_XML_MAPPINGS
mappings: {} mappings: {}
......
[program:cms] [program:cms]
{% if COMMON_ENABLE_NEWRELIC %} {% if COMMON_ENABLE_NEWRELIC -%}
{% set executable = edxapp_venv_dir + '/bin/newrelic-admin run-program ' + edxapp_venv_dir + '/bin/gunicorn' %} {% set executable = edxapp_venv_dir + '/bin/newrelic-admin run-program ' + edxapp_venv_dir + '/bin/gunicorn' -%}
{% else %} {% else -%}
{% set executable = edxapp_venv_dir + '/bin/gunicorn' %} {% set executable = edxapp_venv_dir + '/bin/gunicorn' -%}
{% endif %} {% endif -%}
{% if EDXAPP_LMS_MAX_REQ -%}
{% set max_req = '--max-requests ' + EDXAPP_CMS_MAX_REQ -%}
{% else -%}
{% set max_req = '' + EDXAPP_CMS_MAX_REQ -%}
{% endif -%}
{% if EDXAPP_WORKERS -%} {% if EDXAPP_WORKERS -%}
command={{ executable }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ EDXAPP_WORKERS.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ EDXAPP_WORKERS.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
{% else -%} {% else -%}
{# This is for backwards compatibility, set workers explicitely using EDXAPP_WORKERS #} {# This is for backwards compatibility, set workers explicitely using EDXAPP_WORKERS #}
{% if ansible_processor|length > 0 -%} {% if ansible_processor|length > 0 -%}
command={{ executable }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
{% else -%} {% else -%}
command={{ executable }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
{% endif -%} {% endif -%}
{% endif -%} {% endif -%}
......
[program:lms] [program:lms]
{% if COMMON_ENABLE_NEWRELIC %} {% if COMMON_ENABLE_NEWRELIC -%}
{% set executable = edxapp_venv_dir + '/bin/newrelic-admin run-program ' + edxapp_venv_dir + '/bin/gunicorn' %} {% set executable = edxapp_venv_dir + '/bin/newrelic-admin run-program ' + edxapp_venv_dir + '/bin/gunicorn' -%}
{% else %} {% else -%}
{% set executable = edxapp_venv_dir + '/bin/gunicorn' %} {% set executable = edxapp_venv_dir + '/bin/gunicorn' -%}
{% endif %} {% endif -%}
{% if EDXAPP_LMS_MAX_REQ -%}
{% set max_req = '--max-requests ' + EDXAPP_LMS_MAX_REQ -%}
{% else -%}
{% set max_req = '' + EDXAPP_LMS_MAX_REQ -%}
{% endif -%}
{% if EDXAPP_WORKERS -%} {% if EDXAPP_WORKERS -%}
command={{ executable }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ EDXAPP_WORKERS.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ EDXAPP_WORKERS.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi
{% else -%} {% else -%}
{# This is for backwards compatibility, set workers explicitely using EDXAPP_WORKERS #} {# This is for backwards compatibility, set workers explicitely using EDXAPP_WORKERS #}
{% if ansible_processor|length > 0 -%} {% if ansible_processor|length > 0 -%}
command={{ executable }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi
{% else -%} {% else -%}
command={{ executable }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ worker_core_mult.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi command={{ executable }} {{ max_req }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_lms_gunicorn_port }} -w {{ worker_core_mult.lms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi
{% endif %} {% endif %}
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment