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

Add same-row contention mode to stress tool

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Problem
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
      None

      Description

      For CASSANDRA-2893 and other scenarios we'd like to generate non-unique rows to insert. (Maybe we can re-use the same pseudorandom distribution code we already have for reads.)

      1. CASSANDRA-3498.patch
        10 kB
        Pavel Yaskevich

        Activity

        Hide
        xedin Pavel Yaskevich added a comment -

        new option L (-non-uniq-rows) added.

        Show
        xedin Pavel Yaskevich added a comment - new option L ( -non-uniq-rows) added.
        Hide
        urandom Eric Evans added a comment -

        I used -L in https://issues.apache.org/jira/browse/CASSANDRA-2268 (patches will be along shortly) for --enable-cql. Are there any other short options we could use for this?

        Show
        urandom Eric Evans added a comment - I used -L in https://issues.apache.org/jira/browse/CASSANDRA-2268 (patches will be along shortly) for --enable-cql. Are there any other short options we could use for this?
        Hide
        slebresne Sylvain Lebresne added a comment -

        I understand I'm coming a little late, but I actually remembered that for counters we've introduced the -F option, that allows to specify how many different keys to use. In other word, stress -n 10000 -F 1 will do 10000 insertion on the same row. Maybe that could actually be enough for generating artificial contention ?

        Show
        slebresne Sylvain Lebresne added a comment - I understand I'm coming a little late, but I actually remembered that for counters we've introduced the -F option, that allows to specify how many different keys to use. In other word, stress -n 10000 -F 1 will do 10000 insertion on the same row. Maybe that could actually be enough for generating artificial contention ?
        Hide
        jbellis Jonathan Ellis added a comment -

        how does it distribute updates across rows if n > F?

        Show
        jbellis Jonathan Ellis added a comment - how does it distribute updates across rows if n > F?
        Hide
        slebresne Sylvain Lebresne added a comment -

        It uses a modulo on the 'operation number', so with say -F 3, the producer will generate inserts for keys 0, 1, 2, 0, 1, 2, etc... So it's a bit dumb, but by varying the number of threads, I believe you can control a bit the level of contention (typically, -F 1 means every writes are contending, but say -F 5 with 10 threads means less contention, and then -F 8 with 10 threads even less).

        Show
        slebresne Sylvain Lebresne added a comment - It uses a modulo on the 'operation number', so with say -F 3, the producer will generate inserts for keys 0, 1, 2, 0, 1, 2, etc... So it's a bit dumb, but by varying the number of threads, I believe you can control a bit the level of contention (typically, -F 1 means every writes are contending, but say -F 5 with 10 threads means less contention, and then -F 8 with 10 threads even less).
        Hide
        xedin Pavel Yaskevich added a comment -

        I overlooked -F option and it seems that -F 1 is the behavior we want in this case.

        Show
        xedin Pavel Yaskevich added a comment - I overlooked -F option and it seems that -F 1 is the behavior we want in this case.

          People

          • Assignee:
            xedin Pavel Yaskevich
            Reporter:
            jbellis Jonathan Ellis
            Reviewer:
            Brandon Williams
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development