Added timeout and optimized mysql settings