Tweak mysql timeouts, speed up size calculation