-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️(tray) split websocket and asgi apps in tray
We have detected a memory leak in the websocket application. An issue exists on the django channels github repo about this topic. We also detected that this memory leak can have side effect on the asgi application, the application can become slower leading to timeout. To remove this side effect we decided to create a deploy dedicated to the websocket application and nginx is reponsible to use the right backend based on the request path. django/channels#2094
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% set service_variant = "ws" %} | ||
{% set marsha_replicas = marsha_ws_replicas %} | ||
{% set marsha_livenessprobe = { | ||
"httpGet": { | ||
"path": "/__heartbeat__", | ||
"port": "django-port", | ||
"httpHeaders": [{ | ||
"name": "Host", | ||
"value": marsha_hosts[0], | ||
}], | ||
}, | ||
"initialDelaySeconds": 60, | ||
"periodSeconds": 30 , | ||
} %} | ||
{% set marsha_readynessprobe = { | ||
"httpGet": { | ||
"path": "/__lbheartbeat__", | ||
"port": "django-port", | ||
"httpHeaders": [{ | ||
"name": "Host", | ||
"value": marsha_hosts[0], | ||
}], | ||
}, | ||
"initialDelaySeconds": 10, | ||
"periodSeconds": 5, | ||
} %} | ||
{% set marsha_resources = marsha_ws_resources %} | ||
|
||
{% include "./_deploy_base.yml.j2" with context %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: marsha | ||
service: ws | ||
version: "{{ marsha_image_tag }}" | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
name: marsha-ws-{{ deployment_stamp }} # name of the service should be host name in nginx | ||
namespace: "{{ namespace_name }}" | ||
spec: | ||
ports: | ||
- name: {{ marsha_django_port }}-tcp | ||
port: {{ marsha_django_port }} | ||
protocol: TCP | ||
targetPort: {{ marsha_django_port }} | ||
selector: | ||
app: marsha | ||
deployment: "marsha-ws-{{ deployment_stamp }}" | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters