Skip to content

Commit

Permalink
Add explicit control over gunicorn concurrency in deploys
Browse files Browse the repository at this point in the history
Also remove Redis - we are not using it any more
  • Loading branch information
mrchrisadams committed May 6, 2024
1 parent bdba817 commit 74e3a21
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ansible/inventories/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,36 @@ all:
dramatiq_threads: 2
dramatiq_processes: 3
sentry_sample_rate: 0
app_name: app1
gunicorn_workers: 4
gunicorn_threads: 1

app2.thegreenwebfoundation.org:
internal_ip: "10.0.0.4"
dramatiq_threads: 2
dramatiq_processes: 3
sentry_sample_rate: 0
app_name: app2
gunicorn_workers: 4
gunicorn_threads: 1
# TODO: once we have update the worker process names we can use app3 for serving production traffic
# letting us decommission some of the older app servers
app3.thegreenwebfoundation.org:
internal_ip: "10.0.0.6"
dramatiq_threads: 1
dramatiq_processes: 1
sentry_sample_rate: 1
app_name: app3
gunicorn_workers: 4
gunicorn_threads: 1
app4.thegreenwebfoundation.org:
internal_ip: "10.0.0.7"
dramatiq_threads: 2
dramatiq_processes: 3
sentry_sample_rate: 0
app_name: app4
gunicorn_workers: 4
gunicorn_threads: 1

vars:
tgwf_stage: "prod"
Expand Down
3 changes: 3 additions & 0 deletions ansible/inventories/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ all:
dramatiq_threads: 1
dramatiq_processes: 1
sentry_trace_rate: 1
app_name: "app-staging"
gunicorn_workers: 4
gunicorn_threads: 1
vars:
tgwf_stage: "staging"
tgwf_domain_name: "admin-staging"
Expand Down
3 changes: 2 additions & 1 deletion ansible/templates/dotenv.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ OBJECT_STORAGE_ACCESS_KEY_ID = "{{ lookup('env', 'OBJECT_STORAGE_ACCESS_KEY_ID')
OBJECT_STORAGE_SECRET_ACCESS_KEY = "{{ lookup('env', 'OBJECT_STORAGE_SECRET_ACCESS_KEY') }}"
OBJECT_STORAGE_BUCKET_NAME = "{{ lookup('env', 'OBJECT_STORAGE_BUCKET_NAME') }}"

REDIS_HOST = "{{ lookup('env', 'REDIS_HOST') }}"

AMAZON_PROVIDER_ID = "{{ lookup('env', 'AMAZON_PROVIDER_ID') }}"
AMAZON_REMOTE_API_ENDPOINT = "{{ lookup('env', 'AMAZON_REMOTE_API_ENDPOINT') }}"
Expand All @@ -44,3 +43,5 @@ API_URL = "{{ lookup('env', 'API_URL') }}"


TRELLO_REGISTRATION_EMAIL_TO_BOARD_ADDRESS = "{{ lookup('env', 'TRELLO_REGISTRATION_EMAIL_TO_BOARD_ADDRESS') }}"
GUNICORN_WORKERS={{ gunicorn_workers }}
GUNICORN_THREADS={{ gunicorn_threads }}

0 comments on commit 74e3a21

Please sign in to comment.