optimize the do-rebalance function which scales bolt in the
descend order by capacity.
done optimizing the do-rebalance function which scales bolt in the
descend order by capacity.