Skip to content

Weirdly inconsistent insert performance on 2-node cluster #2529

Closed

Description

@danielmewes

When I insert small documents into a table with soft durability with servers running on magneto and electro I get very weirdly inconsistent insert throughputs.

  1. Sometimes the insert rate on a new table would first go up to a high value, then drop to 0 and remain there for about 1 second before resuming at its regular speed. I could even reproduce this on a single node
  2. With only one node in a cluster, I got stable insert rates of ~20k inserts/s. With two nodes in the cluster (but the table still being on only the one same node as before), I one time got about the same rate. Another time I got a maximum of ~6k which was extremely stable.
  3. Sharding the table into 2 shards did not improve the throughput over the rate I got with a single node. That is very odd, especially since I connected clients directly to both nodes in the cluster and they are not CPU bound or anything like that.

Overall this is super weird. I can run the experiment five times and each time the performance behavior is different. Sometimes I get 6k inserts/s, another time I get 14k, then 20k. In either case, it seems to "stick" for a while with whichever rate it started with more or less. Sometimes it changes after a few minutes. Sometimes it has the stall at the beginning. Other times it doesn't.

Activity

  1. added this to the milestone on Jun 10, 2014
  2. self-assigned this
    on Jun 10, 2014
  3. mlucy commented on Jun 10, 2014

    @mlucy
    Member

    Is this insert performance coming from the web UI, or are you counting in the clients?

  4. danielmewes commented on Jun 10, 2014

    @danielmewes
    MemberAuthor

    Web UI. I can measure on the client just to make sure.

  5. danielmewes commented on Jun 10, 2014

    @danielmewes
    MemberAuthor

    The differences are real and can be measured in the client. Just now I had the following:
    It was happily inserting at ~20k inserts/s.
    I stopped the client. After a few seconds started it again. The average insertion rate after that was ~2k for about 15 seconds (in the web UI plot I could see that it oscillated between 0k and 5k at a frequency of roughly 1 Hz). Then it suddenly returned to a rate of close to 20k and remained there.

    I've restarted the client three more times after that and it immediately went up to the high rate each time.

  6. mlucy commented on Jun 10, 2014

    @mlucy
    Member

    When you measure in the clients, do you ever see the behavior where things hold steady at 6k/s instead of 20k/s?

  7. danielmewes commented on Jun 11, 2014

    @danielmewes
    MemberAuthor

    When you measure in the clients, do you ever see the behavior where things hold steady at 6k/s instead of 20k/s?

    Yes just got it now. It's very stable between 5000 and 5200 qps (with an occasional 49xx and sometimes higher values < 6000 qps in there).

    5k ips
    (the web UI plot matches the measurements of the client)

  8. mlucy commented on Jun 11, 2014

    @mlucy
    Member

    That's certainly very strange. Is it related at all to what thread the client ends up being served by?

  9. danielmewes commented on Jun 11, 2014

    @danielmewes
    MemberAuthor

    Interesting thought. I will check that.

  10. danielmewes commented on Jun 11, 2014

    @danielmewes
    MemberAuthor

    The thread doesn't appear to matter.

  11. danielmewes commented on Jun 12, 2014

    @danielmewes
    MemberAuthor

    Got it boiled down to a case where the throughput is either 5k/s or ~40k/s.
    The setup is as follows:
    2 nodes, let's call them electro and magneto
    A table T on magneto
    A single client, connecting to electro

    The RethinkDB instance on magneto was started with -j electro.

    To get 5k/s:
    Keep the instance on magneto running.
    (Re)Start the instance on electro without any argument. magneto will connect to electro after a while.

    To get 40k/s:
    Keep the instance on magneto running.
    (Re)Start the instance on electro with the argument -j magneto. electro will connect to magneto.

    For a totally mysterious reason, it appears to matter a lot which node initiates the intra-cluster connection.

  12. danielmewes commented on Jun 12, 2014

    @danielmewes
    MemberAuthor

    The asymmetry stems from the fact that we aren't setting the TCP_NODELAY socket option on outgoing connections. Only on incoming ones.

    Going to prepare a fix. That should solve a lot of clustering scalability/performance issues.

  13. modified the milestones: 1.13, on Jun 12, 2014
  14. danielmewes commented on Jun 12, 2014

    @danielmewes
    MemberAuthor

    In CR 1633 by @Tryneus

  15. danielmewes commented on Jun 12, 2014

    @danielmewes
    MemberAuthor

    Fixed in v1.13.x 64f2e2e and next.

  16. modified the milestones: 1.13.1, 1.13 on Jun 26, 2014
  17. added a commit that references this issue on Jun 26, 2014
  18. modified the milestones: 1.13, 1.13.1 on Jun 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions