Skip to content

Commit

Permalink
Add the posibility to adjust the OOM score (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
eRadical authored and DavidWittman committed Mar 19, 2018
1 parent 88eab7e commit 9d00d7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ redis_group: "{{ redis_user }}"

# The open file limit for Redis/Sentinel
redis_nofile_limit: 16384
redis_oom_score_adjust: 0

## Role options
# Configure Redis as a service
Expand Down Expand Up @@ -104,6 +105,7 @@ redis_sentinel_port: 26379
redis_sentinel_pidfile: /var/run/redis/sentinel_{{ redis_sentinel_port }}.pid
redis_sentinel_logfile: '""'
redis_sentinel_syslog_ident: sentinel_{{ redis_sentinel_port }}
redis_sentinel_oom_score_adjust: 0
redis_sentinel_monitors:
- name: master01
host: localhost
Expand Down
4 changes: 4 additions & 0 deletions templates/default/redis.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Restart=always
User={{ redis_user }}
Group={{ redis_group }}

{% if redis_oom_score_adjust != 0 %}
OOMScoreAdjust={{ redis_oom_score_adjust }}
{% endif %}

UMask=007
PrivateTmp=yes
LimitNOFILE={{ redis_nofile_limit }}
Expand Down
4 changes: 4 additions & 0 deletions templates/default/redis_sentinel.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Restart=always
User={{ redis_user }}
Group={{ redis_group }}

{% if redis_sentinel_oom_score_adjust != 0 %}
OOMScoreAdjust={{ redis_sentinel_oom_score_adjust }}
{% endif %}

UMask=007
PrivateTmp=yes
LimitNOFILE={{ redis_nofile_limit }}
Expand Down

0 comments on commit 9d00d7a

Please sign in to comment.