Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-1632

Thread workflow and cpu affinity

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1 beta1
    • None

    Description

      Here are some thoughts I wanted to write down, we need to run some serious benchmarks to see the benefits:

      1) All thread pools for our stages use a shared queue per stage. For some stages we could move to a model where each thread has its own queue. This would reduce lock contention on the shared queue. This workload only suits the stages that have no variance, else you run into thread starvation. Some stages that this might work: ROW-MUTATION.

      2) Set cpu affinity for each thread in each stage. If we can pin threads to specific cores, and control the workflow of a message from Thrift down to each stage, we should see improvements on reducing L1 cache misses. We would need to build a JNI extension (to set cpu affinity), as I could not find anywhere in JDK where it was exposed.

      3) Batching the delivery of requests across stage boundaries. Peter Schuller hasn't looked deep enough yet into the JDK, but he thinks there may be significant improvements to be had there. Especially in high-throughput situations. If on each consumption you were to consume everything in the queue, rather than implying a synchronization point in between each request.

      Attachments

        1. 1632_batchRead-v1.diff
          7 kB
          Jason Brown
        2. 1632-v2.txt
          6 kB
          Jonathan Ellis
        3. 1632-v3.diff
          4 kB
          Jason Brown
        4. 1632-v4.diff
          5 kB
          Jason Brown
        5. patch_v5.diff
          7 kB
          Benedict Elliott Smith
        6. patch_v5a.diff
          7 kB
          Benedict Elliott Smith
        7. threadAff_reads.txt
          7 kB
          Jason Brown
        8. threadAff_writes.txt
          4 kB
          Jason Brown

        Issue Links

          Activity

            People

              jasobrown Jason Brown
              lenn0x Chris Goffinet
              Jason Brown
              Jonathan Ellis
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: