You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Indexing causes high server load, and bad performance #1358
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.
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.
@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...
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.
@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)).
@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
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?
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.
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.
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
.
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.
@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.
Activity
jdoliner commentedon Aug 26, 2013
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.
danielmewes commentedon Aug 26, 2013
@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...
wojons commentedon Aug 26, 2013
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.
jdoliner commentedon Aug 26, 2013
@danielmewes this is almost certainly an issue with disk boundedness.
wojons commentedon Aug 26, 2013
@jdoliner and @danielmewes i can give you access to the server monitoring?
coffeemug commentedon Aug 27, 2013
@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)).
wojons commentedon Aug 27, 2013
@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
coffeemug commentedon Aug 27, 2013
@wojons -- unfortunately you have to reimport all data since the change required a change in the file format.
wojons commentedon Aug 27, 2013
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?
coffeemug commentedon Aug 27, 2013
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?
jdoliner commentedon Aug 27, 2013
I think he's asking if indexing propagates correctly when you shard/unshard which it does.
wojons commentedon Aug 27, 2013
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.
coffeemug commentedon Aug 27, 2013
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.
wojons commentedon Aug 27, 2013
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
coffeemug commentedon Aug 28, 2013
Ah, I see. You should try
rethinkdb dumpandrethinkdb restorecommands as documented here: http://rethinkdb.com/docs/migration/.wojons commentedon Aug 28, 2013
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.
coffeemug commentedon Aug 28, 2013
Ok -- check out this article for a guide on how to write performant scripts -- http://rethinkdb.com/docs/troubleshooting/#my-insert-queries-are-slow.-how-can-i-speed-t
wojons commentedon Aug 28, 2013
Okay perfect i think i am ready to when ever you guys are just send me a message here when you launch 1.9
coffeemug commentedon Aug 28, 2013
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!
wojons commentedon Sep 11, 2013
@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?
coffeemug commentedon Sep 11, 2013
@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.
wojons commentedon Sep 11, 2013
@coffeemug perfect, and congrats
mlucy commentedon Sep 17, 2013
@coffeemug -- what's the status of this issue? It's in 1.9.x, but I'm not sure what to do with it.
jdoliner commentedon Sep 17, 2013
This is just here to remind us to alert the user when we ship 1.9.
mlucy commentedon Sep 17, 2013
Didn't we already ship 1.9?
jdoliner commentedon Sep 17, 2013
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.
wojons commentedon Sep 17, 2013
I will test out the bug in the next day or so.
On Sep 16, 2013 7:34 PM, "Joe Doliner" [email protected] wrote:
wojons commentedon Oct 19, 2013
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.
coffeemug commentedon Oct 21, 2013
@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.