Skip to content

Indexing causes high server load, and bad performance #1358

Closed

Description

@wojons

After importing a 8 million document database with many tables of different sizes most of them needed 3 secondary indexes, When trying to do almost anything on the server or rethinkdb is almost impossible, load average goes between 10-40 on a dual core server. Now i understand that high load for indexing is expected but if the processes that ran the indexing on rethinkdb were set with nice. it would allow other processes to push them aside maybe things like cronjob that normally run on the server, if the main db processes was still with normal linux priority it would mean results will return faster pushing the indexing aside.

The reason I bring this up is, as it stands anytime that I would want to build a new index i would need to put the app in to maintenance.

Activity

  1. jdoliner commented on Aug 26, 2013

    @jdoliner
    Contributor

    This is very likely fixed in next due to #752 being fixed. RethinkDB doesn't use a separate process for indexing and doing so would be basically impossible architecturally at this point. If it's feasible I'd recommend running the version out of next I suspect that this will completely eliminate the problem. If not we could look in to doing a release for it.

  2. danielmewes commented on Aug 26, 2013

    @danielmewes
    Member

    @wojons Is this only the load value going up or the actual CPU usage?
    If it is just the load value, you could try running the RethinkDB server with the --io-threads 8 command line option.

    You mention that doing almost anything on the server becomes impossible though, so I guess it is actually the CPU or disk being saturated...

  3. wojons commented on Aug 26, 2013

    @wojons
    ContributorAuthor

    Most things are okay because it is IO wait. The cpu jitters and load average both go up the cpu time being used in non idle is +95% the entire time. I do have other processes that do take much longer to run now they are usable i can login i can still htop and so on but the load average also does get a lot worse if i do anything else . What will the extra io-threads do.

    The reason i was recommending using nice would mean otherrethinkdb tasks can run in non nice and be able to run the database almost normally.

  4. jdoliner commented on Aug 26, 2013

    @jdoliner
    Contributor

    @danielmewes this is almost certainly an issue with disk boundedness.

  5. wojons commented on Aug 26, 2013

    @wojons
    ContributorAuthor

    @jdoliner and @danielmewes i can give you access to the server monitoring?

  6. coffeemug commented on Aug 27, 2013

    @coffeemug
    Contributor

    @wojons -- we're going to ship 1.9 in a few days which will include a huge performance fix to secondary indexes. Would it be possible for you to rerun the test then to see if the problem still shows up? This issue will almost certainly be fixed (due to #1358 (comment)).

  7. wojons commented on Aug 27, 2013

    @wojons
    ContributorAuthor

    @coffeemug yes i can would deleting the secondray indexes and adding them back have the same effect or would you like me to reiimport all the data / subset of the data and then add secondray indexes

  8. coffeemug commented on Aug 27, 2013

    @coffeemug
    Contributor

    @wojons -- unfortunately you have to reimport all data since the change required a change in the file format.

  9. wojons commented on Aug 27, 2013

    @wojons
    ContributorAuthor

    That is not a problem just let me know when you ship 1.9 i think 1.8 has only been out for a week or two on thursday but i will setup a reimport i will have it this time run faster and stuff like that. is it okay if i have it sharded first and then remove the shards and then index?

  10. coffeemug commented on Aug 27, 2013

    @coffeemug
    Contributor

    Cool, 1.9 should be out in a few days.

    I'm not sure what you mean by "is it okay if i have it sharded first and then remove the shards and then index?" Could you clarify?

  11. jdoliner commented on Aug 27, 2013

    @jdoliner
    Contributor

    I think he's asking if indexing propagates correctly when you shard/unshard which it does.

  12. wojons commented on Aug 27, 2013

    @wojons
    ContributorAuthor

    Last time i did the import it took about a week since i was not using soft duriblity and only had 1 node, I was thinking of doing a 3 node cluster and then once the import is done remove the shards and have all the data on one machine.

  13. coffeemug commented on Aug 27, 2013

    @coffeemug
    Contributor

    Oh, I see. This should work. How much data do you have that it took a week? We're doing dump/restore benchmarking now, so having some idea of how many documents you have and how big they are would help with the benchmark.

  14. wojons commented on Aug 27, 2013

    @wojons
    ContributorAuthor

    Before i was importing over a simple serial script with no soft durblity. the file is 5.4gb and it was 8.5 million recorrds

  15. coffeemug commented on Aug 28, 2013

    @coffeemug
    Contributor
  16. wojons commented on Aug 28, 2013

    @wojons
    ContributorAuthor

    I will try it out but it would also be good for me to learn to write fast import scripts bsed on the use case i need rethinkdb for.

  17. wojons commented on Aug 28, 2013

    @wojons
    ContributorAuthor

    Okay perfect i think i am ready to when ever you guys are just send me a message here when you launch 1.9

  18. coffeemug commented on Aug 28, 2013

    @coffeemug
    Contributor

    Cool, will do in a few days. Assigning to 1.9 milestone so we don't forget to ping you when the release goes out.

    Thanks so much for your patience!

  19. wojons commented on Sep 11, 2013

    @wojons
    ContributorAuthor

    @coffeemug not sure if 1.9 was released i see on the site that it is but did not get a message here and also the sites doc is missing a changelog?

  20. coffeemug commented on Sep 11, 2013

    @coffeemug
    Contributor

    @wojons -- we're going through the release process right now. 1.9 is now available, we'll be publishing the announcement and new site in the morning.

  21. wojons commented on Sep 11, 2013

    @wojons
    ContributorAuthor

    @coffeemug perfect, and congrats

  22. mlucy commented on Sep 17, 2013

    @mlucy
    Member

    @coffeemug -- what's the status of this issue? It's in 1.9.x, but I'm not sure what to do with it.

  23. jdoliner commented on Sep 17, 2013

    @jdoliner
    Contributor

    This is just here to remind us to alert the user when we ship 1.9.

  24. mlucy commented on Sep 17, 2013

    @mlucy
    Member

    Didn't we already ship 1.9?

  25. jdoliner commented on Sep 17, 2013

    @jdoliner
    Contributor

    Yes. Does anyone have @wojons email or something?

    If not I already mentioned him in this so @wojons please learn from this that 1.9 has been shipped and this issue should be resolved.

  26. wojons commented on Sep 17, 2013

    @wojons
    ContributorAuthor

    I will test out the bug in the next day or so.
    On Sep 16, 2013 7:34 PM, "Joe Doliner" [email protected] wrote:

    Yes. Does anyone have @wojons https://github.com/wojons email or
    something?

    If not I already mentioned him in this so @wojonshttps://github.com/wojonsplease learn from this that 1.9 has been shipped and this issue should be
    resolved.

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

  27. wojons commented on Oct 19, 2013

    @wojons
    ContributorAuthor
    r.db('etdemo').table('et_metrics').limit(1)
    r.db('etdemo').table('et_metrics').get("0000b28c-48e6-479a-b0fd-9e754450ad2d")

    under load of building an index on that table it was taking 3 to 4 seconds to pull the doc useing those options. and then the cold query on limit 1 took 14 seconds.

  28. coffeemug commented on Oct 21, 2013

    @coffeemug
    Contributor

    @wojons -- since there were major changes in the secondary index code to lower the load, we'll treat the original issue as fixed. I've opened a new issue (#1556) about throttling secondary index creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions