Skip to content

Improve performance and scalability for workload X #1369

Closed

Description

@coffeemug

I sent this benchmark over e-mail to @mlucy and @jdoliner, but I'm going to post it here instead for collaboration.

Here's the initial setup I think we should focus on (based on all the data I've collated):

  • A cluster of five RethinkDB nodes
  • One large table with ~1 billion documents (event data -- clickstream, network logs, etc.)
    • Each document 1-2KB in size
    • Has the following fields: autogen ID, datetime of the event, customer_id (which customer generate the event), type of event (i.e. user click, network packet, etc.), a bunch of other data (irrelevant what it is, just has to fill up the docs to 1-2KB)
    • Secondary indexes on datetime, customer_id, type of event
  • Five shards
  • Two replicas, two write acks
  • Hard durability

And here's the workload:

  • Constant insert rate of ~5m docs per day (~60 docs/second) -- a total of 16 clients
  • Run queries of the following form
    1. Read a random event event with an id X -- run this query ~1000 times/second, a total of 32 clients
    2. Give me all events of type X for customer Y at time period Z (where time period is about a month) -- run this query once per second, a total of two clients
    3. Give me all events for customer Y -- run this query ten times per second, a total of 8 clients
    4. How many events happened for time period Z (where time period is about a month) -- run this query once per second, a total of 1 client
  • We should periodically drop clients and connect new ones (i.e. pick a random client and reconnect every second).

Stuff to look out for (i.e. requirements that will allow us to call this project done, and RethinkDB good):

  • Latency for write queries and point read queries should never exceed a well-bounded value (say, 5ms)
  • Latency for queries 2-4 shouldn't exceed a reasonable value (say, 20ms - 2s)
  • Time to connect shouldn't exceed a well bounded value (say, 10ms).

We'll also have to test adding a replica. When we bump the replica number by one, we have to test the following:

  • Make sure throughput doesn't drop/latency doesn't increase by a well defined number (e.g. 15%). If the number is higher than 15% it's a show-stopper since it will disrupt a real-time system.
  • How long does it take to add a replica? (should be a well-bounded number on our dataset, e.g. no more than 3-5 hours, with a reasonably correct progress bar). We don't do resharding without interrupting now, so we should only worry about adding replicas.

Activity

  1. ghost assigned on Aug 27, 2013
  2. neumino commented on Aug 27, 2013

    @neumino
    Member

    a bunch of other data (irrelevant what it is, just has to fill up the docs to 1-2KB)

    Last time I tried using big documents (yesterday), I noticed that adding one field to reach 256KB was quite different than adding 256 fields of 1KB (on an Atom, 2GB of RAM and a rotational drive). I can try again if needed.

    We should periodically drop clients and connect new ones (i.e. pick a random client and reconnect every second).

    We should keep a few clients always connected I think. It would be a nice way to know that we don't have leaks when clients stay connected for a long time.

  3. mlucy commented on Aug 27, 2013

    @mlucy
    Member

    I'm going to work on setting this up. I'm gonna go with 2K documents for
    now. I might deviate slightly from the specifications (in particular, I
    think that 4 nodes would be better than 2 with out current resources).

    On Tue, Aug 27, 2013 at 3:19 PM, Michel [email protected] wrote:

    a bunch of other data (irrelevant what it is, just has to fill up the docs
    to 1-2KB)

    Last time I tried using big documents (yesterday), I noticed that adding
    one field to reach 256KB was quite different than adding 256 fields of 1KB
    (on an Atom, 2GB of RAM and a rotational drive). I can try again if needed.

    We should periodically drop clients and connect new ones (i.e. pick a
    random client and reconnect every second).

    We should keep a few clients always connected I think. It would be a nice
    way to know that we don't have leaks when clients stay connected for a long
    time.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/1369#issuecomment-23375945
    .

  4. coffeemug commented on Aug 27, 2013

    @coffeemug
    ContributorAuthor

    @mlucy what do you mean 4 nodes would be better than 2? (the spec says 5, I want to make sure I understand what the benchmark will measure)

  5. bitfrost commented on Aug 27, 2013

    @bitfrost

    Awesome, I had a a very similar use case prototyped out for event data with rethinkdb and decided it wasn't going to meet my needs at the time ran my tests. I will be watching this thread to see where this goes!

  6. mlucy commented on Aug 27, 2013

    @mlucy
    Member

    Typo; I meant 5.

  7. mlucy commented on Aug 28, 2013

    @mlucy
    Member

    I wrote up a more specific summary of our initial workload after talking to Slava:

    Here's the initial setup:

    • 2 servers
    • 4 node cluster, 2 per server, each node has its own SSD
    • 1 table, hard durability, 4 shards, 2 replicas, 2 write acks
    • 1 billion documents, 2 kilobytes each
      • autogen primary key
      • customer_id -- about 1000 customers, Pareto distribution
      • type -- about 10 types, Pareto distribution
      • (Let's start with alpha ~1.161 (80-20), but we can fiddle with this.)
      • datetime -- 5 million docs per day, so about 200 days of data, uniform distribution
      • At least one nested document.
      • At least one array.
      • At least one big chunky string, say 500 bytes long.
    • 3 indexes
      • tbl.index_create('customer_id')
      • tbl.index_create('datetime')
      • tbl.index_create('compound') {|row| [row['customer_id'], row['datetime']]}

    Our scenario is going to be a set of workloads, each doing X ops/sec
    with Y clients. We're first going to improve throughput until we can
    actually get X ops/sec for each workload (we may get that out of the
    box), then we're going to improve latency until we hit our latency
    targets for each workload. (I'm not yet sure what latency targets are
    reasonable; we might end up adjusting them.)

    • .insert(...) # insert rows
      • 60 per second total, one connection per insert
      • 16 clients
      • 95% of queryies have latency <10ms
    • .get(...) # retrieve rows
      • 1000 per second total, one connection per 10 gets
      • 32 clients
      • 95% of queries have latency <5ms # counting 1/10th of connection
    • .between([cid, t1], [cid, t2], :index => 'compound').filter{|row| row['type'].eq(typ)}.reduce{...} # Get all rows of type typ for
      customer cid in a time period t1...t2
      • t1...t2 is one month (like start to end of January), so about 150m rows
      • month is chosen by power law (Slava says last month ~80% of the time)
      • cid and typ are chosen randomly, uniform distribution
      • 1 per second, one connection per query
      • 2 clients
      • 95% of queries have latency <1s
    • .get_all(cid, :index => 'customer_id').groupby('type', r.count) #
      get a summary of user activity over all time
      • cid chosen randomly, uniform distribution
      • 10 per second, one connection per query
      • 8 clients
      • 95% of queries have latency <1s
    • `.between(t1, t2, :index => 'datetime').count
      • 1 per second, one connection per query
      • 2 clients
      • same time distribution as above
      • 95% of queries have latency <1s

    We also have the replica stuff that Slava mentioned, but we should get
    everything else working first.

  8. Tryneus commented on Oct 9, 2013

    @Tryneus
    Member

    Ok, the new stress client has been approved and merged into next. It provides workloads for each of the above traffic types. You run one invocation of the stress client for each traffic type, telling it how many clients, how many total ops/sec, and how many ops to do before creating a new connection. See test/rdb_workloads/README for a more in-depth description and some examples.

    The stress client will then output on stdout the timestamp and latency of each operation when it completes, as well as any errors that occurred. When interrupted, the stress client will shut down and print a summary of the number of operations run and their average latency (on stderr, to not confuse anyone parsing the latency numbers on stdout).

  9. thelinuxlich commented on Oct 9, 2014

    @thelinuxlich

    +1

  10. danielmewes commented on Oct 9, 2014

    @danielmewes
    Member

    @thelinuxlich are there specific workloads you would like to see performance improve for?

    I'm actually inclined to close this issue, because it's rather unspecific and pretty old.
    In the longer term we should try to get workload X benchmarks run automatically and regularly, and then pick out specific areas that we believe need improvements.

  11. thelinuxlich commented on Oct 9, 2014

    @thelinuxlich

    I'm just marking this issue to get updates because as I'm developing a analytics application which once in production will grow to billions of rows, I don't see many use cases like that for RethinkDB so I get a little afraid

  12. danielmewes commented on Oct 9, 2014

    @danielmewes
    Member

    @thelinuxlich You should be able to subscribe to issues through the "Subscribe" button, that should show up below the Labels, Milestone and Assignee on the right in GitHub.

    I'm going to open another issue about running workload X regularly. I will post the issue number here once that's done and then close this one.

  13. thelinuxlich commented on Oct 9, 2014

    @thelinuxlich

    Ok, thanks for the tip!

  14. danielmewes commented on Oct 9, 2014

    @danielmewes
    Member

    Tracking running workload X on a regular basis in issue #3168.

    Closing this issue because it lacks specific actionable items.

  15. modified the milestones: invalid, subsequent on Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions