File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,15 @@ def wait(self):
6767 raise Exception , "Not all mongodump threads completed successfully!" , None
6868
6969 def run (self ):
70- # decide how many parallel dump workers to use based on cpu count vs # of shards (if 3.2+)
71- self .threads_per_dump = 0
70+ # decide how many parallel dump workers to use based on cpu count vs # of shards (if 3.2+), 8 max workers max to protect the db
71+ self .threads_per_dump = 0
72+ self .threads_per_dump_max = 8
7273 if tuple (self .version .split ("." )) >= tuple ("3.2.0" .split ("." )):
7374 self .threads_per_dump = 1
7475 if self .cpu_count > len (self .secondaries ):
7576 self .threads_per_dump = int (floor (self .cpu_count / len (self .secondaries )))
77+ if self .threads_per_dump > self .threads_per_dump_max :
78+ self .threads_per_dump = self .threads_per_dump_max
7679 else :
7780 logging .warn ("Threading unsupported by mongodump version %s. Use mongodump 3.2.0 or greater to enable per-dump threading." % self .version )
7881
You can’t perform that action at this time.
0 commit comments