Permalink
Browse files

Merge "Add memory limitation calculation"

  • Loading branch information...
2 parents 1e46663 + 6ee7948 commit 0aeb3dd66e1038feb602cb76c36df99bdd4da7ef Tang Rui committed with Gerrit Code Review Oct 12, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 ng/redis/bin/redis_node
  2. +1 −0 ng/redis/lib/redis_service/redis_node.rb
View
1 ng/redis/bin/redis_node
@@ -24,6 +24,7 @@ class VCAP::Services::Redis::NodeBin < VCAP::Services::Base::NodeBin
options[:config_template] = File.expand_path("../../resources/redis.conf.erb", __FILE__)
options[:port_range] = parse_property(config, "port_range", Range)
options[:max_memory] = parse_property(config, "max_memory", Integer)
+ options[:memory_overhead] = parse_property(config, "memory_overhead", Integer, :optional => true)
options[:max_swap] = parse_property(config, "max_swap", Integer)
options[:redis_log_dir] = parse_property(config, "redis_log_dir", String)
options[:command_rename_prefix] = parse_property(config, "command_rename_prefix", String)
View
1 ng/redis/lib/redis_service/redis_node.rb
@@ -312,6 +312,7 @@ def init(options)
@logger = options[:logger]
@max_disk = options[:max_disk]
@quota = options[:filesystem_quota] || false
+ @memory_limit = options[:max_memory] + (options[:memory_overhead] || 0)
FileUtils.mkdir_p(base_dir)
FileUtils.mkdir_p(log_dir)
FileUtils.mkdir_p(image_dir)

0 comments on commit 0aeb3dd

Please sign in to comment.