Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1744

Throttle inserts when the cache has lots of dirty content

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.7.0
    • Labels:
      None

      Description

      It would be handy to throttle inserts if the cache becomes very dirty. Otherwise the amount of work required to complete a checkpoint can easily cause applications to stall waiting for space in the cache.

      It's likely that we'll want to add throttling either when a page is first dirtied and/or when an updated is made to a dirty page.

      This probably requires a new configuration setting to wiredtiger_open, something like eviction_dirty_max or eviction_dirty_throttle_trigger. We should throttle more and more aggressively as the proportion of dirty content moves above the setting (or approaches the setting if we want it to be a max).

      We might want to allow the setting to be flexible when a checkpoint is running.

      We will need new logic in the eviction server so that it starts choosing dirty pages to evict and becomes more aggressive about it as it reaches the target, independent of the current eviction_trigger.

      The goals here are:

      • Limit the amount of work required to complete a checkpoint
      • Allow for very large caches to be helpful for read-mostly workloads
      • Avoid application stalls due to checkpoints pinning transaction IDs and stopping eviction.

        Issue Links

          Activity

          Hide
          michael.cahill Michael Cahill added a comment -

          Related to WT-1350

          Show
          michael.cahill Michael Cahill added a comment - Related to WT-1350
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'}

          Message: Merge __wt_eviction_check, __wt_cache_full_check and __wt_cache_wait
          into __cache_check (a simple cache-size helper function), and a worker
          function, __wt_cache_full_check.

          Add a new parameter to __wt_cache_full_check, set if the caller is
          "busy". It's set for callers stalling for some reason (for example,
          waiting on a disk read). If the caller is busy, we only use it for a
          single page eviction before returning it to its previous task.

          Change the page-in function to check on the cache when a thread is
          about to stall, and evict a page instead of sleeping.

          The way this used to work was a thread would start evicting pages if the
          cache was > 95% full or there were eviction target values we wanted to
          reach, but would evict a single page and quit evicting as soon as the
          cache was < 100% full, regardless of eviction target values. Now we
          continue working until we both reach < 95% and the eviction target
          values, that is, we'll throttle threads unless they're currently "busy".

          Reference WT-1744.
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/ed9808a617a9fee825b9c33534ad9658693246d4

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'} Message: Merge __wt_eviction_check, __wt_cache_full_check and __wt_cache_wait into __cache_check (a simple cache-size helper function), and a worker function, __wt_cache_full_check. Add a new parameter to __wt_cache_full_check, set if the caller is "busy". It's set for callers stalling for some reason (for example, waiting on a disk read). If the caller is busy, we only use it for a single page eviction before returning it to its previous task. Change the page-in function to check on the cache when a thread is about to stall, and evict a page instead of sleeping. The way this used to work was a thread would start evicting pages if the cache was > 95% full or there were eviction target values we wanted to reach, but would evict a single page and quit evicting as soon as the cache was < 100% full, regardless of eviction target values. Now we continue working until we both reach < 95% and the eviction target values, that is, we'll throttle threads unless they're currently "busy". Reference WT-1744 . Branch: develop https://github.com/wiredtiger/wiredtiger/commit/ed9808a617a9fee825b9c33534ad9658693246d4

            People

            • Assignee:
              keith.bostic Keith Bostic
              Reporter:
              alexander.gorrod Alexander Gorrod
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: