add batchsize, flush connection