Merge pull request #2632 from alphagov/scaling-fix

scale up api to 25 instances before deploy on production
This commit is contained in:
Leo Hemsted
2019-10-15 11:07:14 +01:00
committed by GitHub
+21 -4
View File
@@ -1,12 +1,28 @@
{%- set app_vars = { {%- set app_vars = {
'notify-api': {'NOTIFY_APP_NAME': 'api', 'disk_quota': '2G', 'sqlalchemy_pool_size': 20, 'routes': { 'notify-api': {
'NOTIFY_APP_NAME': 'api',
'disk_quota': '2G',
'sqlalchemy_pool_size': 20,
'routes': {
'preview': ['api.notify.works'], 'preview': ['api.notify.works'],
'staging': ['api.staging-notify.works'], 'staging': ['api.staging-notify.works'],
'production': ['api.notifications.service.gov.uk'], 'production': ['api.notifications.service.gov.uk'],
}, },
'health-check-type': 'port', 'health-check-type': 'port',
'instances': {
'preview': None,
'staging': None,
'production': 25
},
},
'notify-api-db-migration': {
'NOTIFY_APP_NAME': 'api',
'instances': {
'preview': 0,
'staging': 0,
'production': 0
},
}, },
'notify-api-db-migration': {'NOTIFY_APP_NAME': 'api', 'instances': 0},
'notify-delivery-celery-beat': {'memory': '128M'}, 'notify-delivery-celery-beat': {'memory': '128M'},
'notify-delivery-worker-jobs': {}, 'notify-delivery-worker-jobs': {},
@@ -23,14 +39,15 @@
} -%} } -%}
{%- set app = app_vars[CF_APP] -%} {%- set app = app_vars[CF_APP] -%}
{%- set instance_count = app.get('instances', {}).get(environment) -%}
--- ---
applications: applications:
- name: {{ CF_APP }} - name: {{ CF_APP }}
buildpack: python_buildpack buildpack: python_buildpack
{% if 'instances' in app %} {% if instance_count is not none %}
instances: {{ app['instances'] }} instances: {{ instance_count }}
{%- endif %} {%- endif %}
memory: {{ app.get('memory', '1G') }} memory: {{ app.get('memory', '1G') }}
disk_quota: {{ app.get('disk_quota', '1G')}} disk_quota: {{ app.get('disk_quota', '1G')}}