How to set batchsize?

This duplicates How to do dynamic batch packaging of plaintext? - #2 by ypolyakov