eviction policy and maxmemory
we're low on resources so 50MB is the most we can give it
This commit is contained in:
parent
f3620e7c49
commit
4c5861f9b8
2 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
FROM sutty/monit:latest
|
FROM sutty/monit:latest
|
||||||
MAINTAINER "f <f@sutty.nl>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
RUN apk add --no-cache redis su-exec
|
RUN apk add --no-cache redis
|
||||||
|
|
||||||
COPY ./monit.conf /etc/monit.d/redis.conf
|
COPY ./monit.conf /etc/monit.d/redis.conf
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@ RUN sed -re "s/^(appendonly).*/\1 yes/" -i /etc/redis.conf
|
||||||
RUN echo "pidfile /run/redis/redis.pid" >> /etc/redis.conf
|
RUN echo "pidfile /run/redis/redis.pid" >> /etc/redis.conf
|
||||||
RUN echo "daemonize yes" >> /etc/redis.conf
|
RUN echo "daemonize yes" >> /etc/redis.conf
|
||||||
RUN echo "protected-mode no" >> /etc/redis.conf
|
RUN echo "protected-mode no" >> /etc/redis.conf
|
||||||
|
RUN echo "maxmemory-policy allkeys-lfu" >> /etc/redis.conf
|
||||||
|
RUN echo "maxmemory 50mb" >> /etc/redis.conf
|
||||||
|
|
||||||
EXPOSE 6379
|
EXPOSE 6379
|
||||||
VOLUME "/var/lib/redis"
|
VOLUME "/var/lib/redis"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
check process redis with pidfile /run/redis/redis.pid
|
check process redis with pidfile /run/redis/redis.pid
|
||||||
start program = "/sbin/su-exec redis /usr/bin/redis-server /etc/redis.conf"
|
start program = "/usr/bin/redis-server /etc/redis.conf" as uid "redis" and gid "redis"
|
||||||
stop program = "/usr/bin/redis-cli shutdown"
|
stop program = "/usr/bin/redis-cli shutdown"
|
||||||
if failed port 6379 protocol redis 3 times within 5 cycles then restart
|
if failed port 6379 protocol redis 3 times within 5 cycles then restart
|
||||||
|
|
Loading…
Reference in a new issue