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

FBUtilities.hash can result in thread contention on call to MessageDigest.getInstance()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.7.0
    • None
    • None

    Description

      FBUtilities.hash() calls MessageDigest.getInstance() on every invocation, which in turns calls the synchronized method Provider.getService(). FBUtilities.md5hash() is frequently invoked from RandomPartitioner, and minor thread contention in this codepath can be observed when running contrib/py_stress against an out-of-box Cassandra installation.

      One possible solution is to preallocate md5 MessageDigest instances and store them as threadlocals.

      Attachments

        1. 1369-v2.txt
          3 kB
          Jonathan Ellis
        2. 1369.txt
          1 kB
          Brandon Williams

        Activity

          People

            brandon.williams Brandon Williams
            jfager Jason Fager
            Brandon Williams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: