Cassandra
  1. Cassandra
  2. CASSANDRA-4316

Compaction Throttle too bursty with large rows

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 1.2.5
    • Component/s: None
    • Labels:

      Description

      In org.apache.cassandra.db.compaction.CompactionIterable the check for compaction throttling occurs once every 1000 rows. In our workload this is much too large as we have many large rows (16 - 100 MB).

      With a 100 MB row, about 100 GB is read (and possibly written) before the compaction throttle sleeps. This causes bursts of essentially unthrottled compaction IO followed by a long sleep which yields inconsistence performance and high error rates during the bursts.

      We applied a workaround to check throttle every row which solved our performance and error issues:

      line 116 in org.apache.cassandra.db.compaction.CompactionIterable:
      if ((row++ % 1000) == 0)
      replaced with
      if ((row++ % 1) == 0)

      I think the better solution is to calculate how often throttle should be checked based on the throttle rate to apply sleeps more consistently. E.g. if 16MB/sec is the limit then check for sleep after every 16MB is read so sleeps are spaced out about every second.

      1. 4316-1.2.txt
        24 kB
        Jonathan Ellis
      2. 4316-1.2.txt
        16 kB
        Yuki Morishita
      3. 4316-1.2-v2.txt
        17 kB
        Yuki Morishita
      4. 4316-v3.txt
        22 kB
        Jonathan Ellis

        Activity

        Wayne Lewis created issue -
        Wayne Lewis made changes -
        Field Original Value New Value
        Affects Version/s 1.0.9 [ 12319856 ]
        Affects Version/s 1.0.1 [ 12317948 ]
        Jonathan Ellis made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Assignee Yuki Morishita [ yukim ]
        Fix Version/s 1.2 [ 12319262 ]
        Affects Version/s 0.8.0 [ 12316403 ]
        Affects Version/s 1.1.0 [ 12317615 ]
        Affects Version/s 1.0.9 [ 12319856 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Jonathan Ellis made changes -
        Fix Version/s 1.2.1 [ 12322953 ]
        Fix Version/s 1.2.0 [ 12319262 ]
        Jonathan Ellis made changes -
        Priority Minor [ 4 ] Major [ 3 ]
        Yuki Morishita made changes -
        Attachment 4316-1.2.txt [ 12563139 ]
        Yuki Morishita made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Jonathan Ellis made changes -
        Reviewer jbellis
        Yuki Morishita made changes -
        Attachment 4316-1.2-v2.txt [ 12564752 ]
        Yuki Morishita made changes -
        Attachment 4316-1.2-v2.txt [ 12564760 ]
        Yuki Morishita made changes -
        Attachment 4316-1.2-v2.txt [ 12564752 ]
        Jonathan Ellis made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.2.2 [ 12323924 ]
        Fix Version/s 1.2.1 [ 12322953 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12672394 ] patch-available, re-open possible [ 12753710 ]
        Gavin made changes -
        Workflow patch-available, re-open possible [ 12753710 ] reopen-resolved, no closed status, patch-avail, testing [ 12758430 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.2.3 [ 12324089 ]
        Fix Version/s 1.2.2 [ 12323924 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.2.4 [ 12324157 ]
        Fix Version/s 1.2.3 [ 12324089 ]
        Jonathan Ellis made changes -
        Fix Version/s 2.0 [ 12322954 ]
        Fix Version/s 1.2.4 [ 12324157 ]
        Jonathan Ellis made changes -
        Assignee Yuki Morishita [ yukim ] Jonathan Ellis [ jbellis ]
        Jonathan Ellis made changes -
        Attachment 4316-v3.txt [ 12580820 ]
        Jonathan Ellis made changes -
        Fix Version/s 1.2.5 [ 12324301 ]
        Fix Version/s 2.0 [ 12322954 ]
        Reviewer jbellis yukim
        Jonathan Ellis made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Jonathan Ellis made changes -
        Attachment 4316-1.2.txt [ 12581187 ]
        Jonathan Ellis made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ryan McGuire made changes -
        Tester enigmacurry
        Ryan McGuire made changes -
        Attachment wide_row_stress.trunk.log.txt.gz [ 12581572 ]
        Ryan McGuire made changes -
        Attachment wide_row_stress.trunk.log.txt.gz [ 12581572 ]
        Ryan McGuire made changes -
        Labels qa-resolved
        Aleksey Yeschenko made changes -
        Component/s Core [ 12312978 ]

          People

          • Assignee:
            Jonathan Ellis
            Reporter:
            Wayne Lewis
            Reviewer:
            Yuki Morishita
            Tester:
            Ryan McGuire
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development