Created
October 21, 2014 21:20
-
-
Save mattsta/5d142b3c614b86b48822 to your computer and use it in GitHub Desktop.
redis systemd voodoo
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
[Unit] | |
Description=Redis Demo | |
After=network.target | |
[Service] | |
# Port 0 stops Redis from listening to ports by itself | |
ExecStart=/home/matt/repos/redis/src/redis-server --dir /tmp --port 0 | |
PrivateTmp=yes | |
# Redis requires non-blocking sockets or else _nothing_ works | |
NonBlocking=yes | |
# Redis likes nodelay sockets (not supported by my version of systemd) | |
#NoDelay=yes | |
# Set your user and group Redis should run as here | |
User=matt | |
Group=matt | |
# Set ulimit before startup so Redis can accept over 10,000 connections | |
LimitNOFILE=30000 | |
[Install] | |
WantedBy=multi-user.target |
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
[Socket] | |
ListenStream=127.0.0.1:9994 | |
ListenStream=/run/%p.sock | |
# If you use this as an instantiated unit, use per-instance sockets: | |
#ListenStream=/run/%p@%i.sock | |
# Redis likes a 511 backlog | |
Backlog=511 | |
[Install] | |
WantedBy=sockets.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment