add max connections feature
Merge "add max connections feature" into 0.6.x