dynamically set max number of mysql connections