Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update redis recipe

  • Loading branch information...
commit 5f2d0491c02df3aa34f89de77ec18532f45fe735 1 parent 72fcda8
@KlausTrainer KlausTrainer authored
View
23 redis/attributes/default.rb
@@ -1,8 +1,9 @@
default[:redis] = {}
default[:redis][:bind_address] = '0.0.0.0'
default[:redis][:port] = 6379
-default[:redis][:timeout] = 300
-default[:redis][:version] = '2.2.12'
+default[:redis][:timeout] = 0
+default[:redis][:version] = '2.4.12'
+default[:redis][:cli][:version] = redis[:version]
default[:redis][:prefix] = '/usr/local'
default[:redis][:user] = 'redis'
default[:redis][:datadir] = '/var/lib/redis'
@@ -13,7 +14,21 @@
default[:redis][:appendonly] = 'yes'
default[:redis][:aofile] = 'appendonly.aof'
default[:redis][:appendfsync] = 'everysec'
+default[:redis][:no_appendfsync_on_rewrite] = 'no'
+default[:redis][:auto_aof_rewrite_percentage] = '150'
+default[:redis][:auto_aof_rewrite_min_size] = '512mb'
+
+# deprecated VM
default[:redis][:vm] = 'no'
-default[:redis][:vm_max_memory] = '385875968'
+default[:redis][:vm_max_memory] = '3558759680'
default[:redis][:vm_page_size] = '32'
-default[:redis][:vm_pages] = '134217728'
+default[:redis][:vm_pages] = '268435456'
+default[:redis][:swapfile] = '/mnt/redis/redis.swap'
+
+# backup & compaction
+default[:redis][:compact_every_x_days] = "*/1"
+default[:redis][:compact_at] = '3'
+default[:redis][:backup_hour] = "0-23/4"
+default[:redis][:backup_minute] = '30'
+default[:redis][:backupdir] = '/vol/backups/redis'
+default[:redis][:backup_backlog] = 10
View
10 redis/recipes/compact.rb
@@ -0,0 +1,10 @@
+cron "Redis: rewrite append-only file" do
+ minute "0"
+ hour node[:redis][:compact_at]
+ day node[:redis][:compact_every_x_days]
+ month '*'
+ weekday '*'
+ command "#{node[:redis][:prefix]}/bin/redis-cli bgrewriteaof"
+ user "root"
+ path "/usr/bin:/usr/local/bin:/bin"
+end
View
5 redis/recipes/server.rb
@@ -16,13 +16,14 @@
end
directory node[:redis][:datadir] do
+ recursive true
owner node[:redis][:user]
group 'users'
mode '0755'
end
directory File.dirname(node[:redis][:log_file]) do
- action :create
+ recursive true
owner node[:redis][:user]
group 'root'
mode '0755'
@@ -71,3 +72,5 @@
execute "monit reload" do
action :run
end
+
+include_recipe 'redis::compact'
Please sign in to comment.
Something went wrong with that request. Please try again.