anchor.diff:              Quota
       end.
   
  -do_default_quota(kv, Memory) ->
  -    KvQuota = (Memory * 3) div 5,
  -    {?MIN_BUCKET_QUOTA, KvQuota};
  -do_default_quota(index, Memory) ->
  -    IndexQuota = (Memory * 3) div 5,
  -    {min_quota(index), IndexQuota};
  -do_default_quota(fts, Memory) ->
  -    FTSQuota = min(Memory div 5, ?MAX_DEFAULT_FTS_QUOTA),
  -    {min_quota(fts), FTSQuota};
  -do_default_quota(cbas, Memory) ->
  -    CBASQuota = Memory div 5,
  -    {min_quota(cbas), CBASQuota}.
  -
  -services_ranking() ->
  -    [kv, cbas, index, fts].
  +calculate_default_quota(kv, Memory) ->
  +    (Memory * 3) div 5;
  +calculate_default_quota(index, Memory) ->
  +    (Memory * 3) div 5;
  +calculate_default_quota(fts, Memory) ->
  +    min(Memory div 5, ?MAX_DEFAULT_FTS_QUOTA);
  +calculate_default_quota(cbas, Memory) ->
  +    Memory div 5.
   
   default_quotas(Services) ->
       %% this is actually bogus, because nodes can be heterogeneous; but that's
  
positive.code:     SetFn(service_to_quota_key(Service), Quota, Cfg).
  
  default_quota(Service, Memory, Max) ->
      {Min, Quota} = do_default_quota(Service, Memory),
  
      %% note that this prefers enforcing minimum quota which for very small
      %% amounts of RAM can result in combined quota be actually larger than RAM
  
negative.code:     1024.
  
  check_service_quota(kv, Quota, Config) ->
      BucketsQuota = get_total_buckets_ram_quota(Config) div ?MIB,
      MinMemoryMB = erlang:max(min_quota(kv), BucketsQuota),
      check_min_quota(kv, MinMemoryMB, Quota);
  check_service_quota(Service, Quota, _) ->
      check_min_quota(Service, min_quota(Service), Quota).
  