mirror of
https://github.com/Thumbscrew/matrix-homeserver-docker-compose.git
synced 2025-04-12 18:23:42 +00:00
add workers and mem limits
This commit is contained in:
parent
8a6dda10b1
commit
40d964cd14
@ -38,8 +38,9 @@ services:
|
|||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
max-size: "1G"
|
max-size: "100M"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
mem_limit: ${SYNAPSE_MEM_LIMIT:-2g}
|
||||||
ports:
|
ports:
|
||||||
- ${SYNAPSE_PORT}:8008
|
- ${SYNAPSE_PORT}:8008
|
||||||
networks:
|
networks:
|
||||||
@ -53,3 +54,105 @@ services:
|
|||||||
TZ: ${TZ}
|
TZ: ${TZ}
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
|
||||||
|
synapse-worker-1:
|
||||||
|
image: matrixdotorg/synapse:${SYNAPSE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: ["/start.py", "run", "--config-path=/data/${CONFIG_FILE_NAME}", "--config-path=/data/generic_worker_1.yaml"]
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -fSs http://localhost:8081/health || exit 1"]
|
||||||
|
start_period: "5s"
|
||||||
|
interval: "15s"
|
||||||
|
timeout: "5s"
|
||||||
|
volumes:
|
||||||
|
- ${VOLUME_PATH}/data:/data:rw
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "100M"
|
||||||
|
max-file: "3"
|
||||||
|
mem_limit: ${WORKER_MEM_LIMIT:-512m}
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
environment:
|
||||||
|
SYNAPSE_CONFIG_DIR: /data
|
||||||
|
SYNAPSE_WORKER: synapse.app.generic_worker
|
||||||
|
depends_on:
|
||||||
|
- synapse
|
||||||
|
|
||||||
|
synapse-worker-2:
|
||||||
|
image: matrixdotorg/synapse:${SYNAPSE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: ["/start.py", "run", "--config-path=/data/${CONFIG_FILE_NAME}", "--config-path=/data/generic_worker_2.yaml"]
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -fSs http://localhost:8081/health || exit 1"]
|
||||||
|
start_period: "5s"
|
||||||
|
interval: "15s"
|
||||||
|
timeout: "5s"
|
||||||
|
volumes:
|
||||||
|
- ${VOLUME_PATH}/data:/data:rw
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "100M"
|
||||||
|
max-file: "3"
|
||||||
|
mem_limit: ${WORKER_MEM_LIMIT:-512m}
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
environment:
|
||||||
|
SYNAPSE_CONFIG_DIR: /data
|
||||||
|
SYNAPSE_WORKER: synapse.app.generic_worker
|
||||||
|
depends_on:
|
||||||
|
- synapse
|
||||||
|
|
||||||
|
synapse-federation-sender-1:
|
||||||
|
image: matrixdotorg/synapse:${SYNAPSE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: ["/start.py", "run", "--config-path=/data/${CONFIG_FILE_NAME}", "--config-path=/data/federation_sender_worker_1.yaml"]
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -fSs http://localhost:8081/health || exit 1"]
|
||||||
|
start_period: "5s"
|
||||||
|
interval: "15s"
|
||||||
|
timeout: "5s"
|
||||||
|
volumes:
|
||||||
|
- ${VOLUME_PATH}/data:/data:rw
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "100M"
|
||||||
|
max-file: "3"
|
||||||
|
mem_limit: ${WORKER_MEM_LIMIT:-512m}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
environment:
|
||||||
|
SYNAPSE_CONFIG_DIR: /data
|
||||||
|
SYNAPSE_WORKER: synapse.app.federation_sender
|
||||||
|
depends_on:
|
||||||
|
- synapse
|
||||||
|
|
||||||
|
synapse-federation-sender-2:
|
||||||
|
image: matrixdotorg/synapse:${SYNAPSE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: ["/start.py", "run", "--config-path=/data/${CONFIG_FILE_NAME}", "--config-path=/data/federation_sender_worker_2.yaml"]
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -fSs http://localhost:8081/health || exit 1"]
|
||||||
|
start_period: "5s"
|
||||||
|
interval: "15s"
|
||||||
|
timeout: "5s"
|
||||||
|
volumes:
|
||||||
|
- ${VOLUME_PATH}/data:/data:rw
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "100M"
|
||||||
|
max-file: "3"
|
||||||
|
mem_limit: ${WORKER_MEM_LIMIT:-512m}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
environment:
|
||||||
|
SYNAPSE_CONFIG_DIR: /data
|
||||||
|
SYNAPSE_WORKER: synapse.app.federation_sender
|
||||||
|
depends_on:
|
||||||
|
- synapse
|
||||||
|
Loading…
Reference in New Issue
Block a user