redis.conf.j2 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # {{ ansible_managed }}
  2. pidfile /var/run/{{ redis_daemon }}.pid
  3. port {{ redis_port }}
  4. bind 0.0.0.0
  5. {% if groups['redis_servers']|length > 1 %}
  6. {% if ansible_fqdn != groups['redis_servers'][0] %}
  7. slaveof {{ groups['redis_servers'][0] }} {{ redis_port }}
  8. {% endif %}
  9. {% endif %}
  10. {% if redis_unixsocket %}
  11. unixsocket {{ redis_unixsocket }}
  12. unixsocketperm 775
  13. {% endif %}
  14. timeout {{ redis_timeout }}
  15. loglevel {{ redis_loglevel }}
  16. logfile {{ redis_logfile }}
  17. databases {{ redis_databases }}
  18. {% for save in redis_save %}
  19. save {{ save }}
  20. {% endfor %}
  21. rdbcompression {{ redis_rdbcompression }}
  22. dbfilename {{ redis_dbfilename }}
  23. dir {{ redis_dbdir }}
  24. protected-mode {{ redis_protected_mode }}
  25. tcp-backlog 511
  26. tcp-keepalive 300
  27. daemonize {{ redis_daemonize }}
  28. supervised no
  29. always-show-logo yes
  30. stop-writes-on-bgsave-error yes
  31. rdbchecksum yes
  32. replica-serve-stale-data yes
  33. replica-read-only yes
  34. repl-diskless-sync no
  35. repl-diskless-sync-delay 5
  36. repl-disable-tcp-nodelay no
  37. replica-priority 100
  38. lazyfree-lazy-eviction no
  39. lazyfree-lazy-expire no
  40. lazyfree-lazy-server-del no
  41. replica-lazy-flush no
  42. appendonly no
  43. appendfilename "appendonly.aof"
  44. appendfsync everysec
  45. no-appendfsync-on-rewrite no
  46. auto-aof-rewrite-percentage 100
  47. auto-aof-rewrite-min-size 64mb
  48. aof-load-truncated yes
  49. aof-use-rdb-preamble yes
  50. lua-time-limit 5000
  51. slowlog-log-slower-than 10000
  52. slowlog-max-len 128
  53. latency-monitor-threshold 0
  54. notify-keyspace-events ""
  55. hash-max-ziplist-entries 512
  56. hash-max-ziplist-value 64
  57. list-max-ziplist-size -2
  58. list-compress-depth 0
  59. set-max-intset-entries 512
  60. zset-max-ziplist-entries 128
  61. zset-max-ziplist-value 64
  62. hll-sparse-max-bytes 3000
  63. stream-node-max-bytes 4096
  64. stream-node-max-entries 100
  65. activerehashing yes
  66. client-output-buffer-limit normal 0 0 0
  67. client-output-buffer-limit replica 256mb 64mb 60
  68. client-output-buffer-limit pubsub 32mb 8mb 60
  69. hz 10
  70. dynamic-hz yes
  71. aof-rewrite-incremental-fsync yes
  72. rdb-save-incremental-fsync yes
  73. maxclients 512