-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throttle import #3795
Throttle import #3795
Conversation
@@ -146,7 +162,7 @@ func (i *Importer) processDML(scanner *bufio.Scanner) { | |||
if strings.HasPrefix(line, "#") { | |||
continue | |||
} | |||
i.batchAccumulator(line) | |||
i.batchAccumulator(line, start) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, but I wouldn't bother with the variable. i.batchAccumulator(line, time.Now())
. Purely cosmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't cosmetic. It has to be at the beginning before the loop or it won't be able to calculate the total time lapsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK, I misinterpreted the code. Thanks @corylanou
OK, I see how it works. There are lots of ways to do this kind of thing, this works. +1 |
cherry picked into 0.9.3 |
Yes pls! |
This adds the ability to throttle the import.
Currently, unthrottled on my machine it tops out at about 160k points per second importing. I have not been able to saturate the system so it may be that some people won't need this option.
To throttle, you use the following command:
Which is stating that you don't want MORE than 50,000 points per second to write to the database. Due to the processing that is taking place however, you will likely never get exactly 50,000 pps, more like 35,000 pps, etc.
I added a status message as well that will give you stats on the progress of the import that shows up like this: