Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-46139

getMinMemory calculation is wrong when resident ratio is low

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 6.6.2
    • secondary-index
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      Found out that when resident ratio is low our minMemory calculation predicts high minMemory requirement compared to what it should be.

      Observation so far.

      when resident ratio is high say more than 40% minMemory calculation is close to accurate but when resident ratio is closer to 0 ( 1% 4% etc) minMemory calculation provides value which is very high, this causes planner to fail with minMemory requirement constraint related failure (Required min memory is more than total indexer quota available).

      As per my experiments 

      mem_size stat for index does not linearly go down with resident ratio. 

      Amount of mem_size needed for say 40% resident ratio vs amount of mem_size needed for say 2% resident ratio are not linear. Also the mem_size_index which is not dependent on resident ratio is being given equal weight in minMemory calculations. I have not done similar analysis for overhead calculations and that too needs to be checked if it has linear relationship with resident ratio (as current minMemory calculation assumes it to be linear relationship)

      Attaching logs from my local repro which shows that at some point when total index data size is about 1.2GB putting 1200MB of indexer quota also does not satisfy minMemory requirement and planner fails to place index(replicas). Logs contain various instances of success or failures with differing resident ratio and indexer quota.

      Same indexes with resident ratio increased (above 30% for most of the indexes) using scans do satisfy min memory requirement with indexer quota as low as 600MB, with all indexes resident ratio  0 (immediately after restart) satisfy minMemory requirement at indexer quota of 400MB and planner is able to place the indexes successfully.

      This shows especially at lower resident ratio it does not have linear relationship with mem_size stat and hence the formula which we use in calculating minMemory ( total_mem * ratio / minResidentRatio(default 0.2)) returns wrong result when actual resident ratio is closer to zero. 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              hemant.rajput Hemant Rajput
              yogendra.acharya Yogendra Acharya (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty