Last active
August 13, 2019 22:09
-
-
Save jmarcos-cano/9b5d16d5e65999875e60f44be4c370df to your computer and use it in GitHub Desktop.
docker-compose file to demonstrate sysctls for docker stacks 🐳
This file contains hidden or 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
version: '3.7' | |
services: | |
redis: | |
image: redis:alpine | |
deploy: | |
mode: global | |
restart_policy: | |
condition: on-failure | |
ports: | |
- 6379:6379 | |
# New sysctls feature introduced in 19.03.0 | |
sysctls: | |
net.core.somaxconn: '1024' | |
# Take some more suggestions from here https://redis.io/topics/admin |
This file contains hidden or 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
#!/bin/bash | |
# stack deploy this very loved gist | |
curl -sL https://git.io/fj5Mu | docker stack deploy --compose-file - redis | |
# or services | |
docker service create --sysctl net.core.somaxconn=1024 --name redis_service redis:alpine sh -c "sysctl net.core.somaxconn ; sleep 100" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment