A good distance is when the plant responds favorably. Getting leggy like that says they need more. If your light is dimmable, then you can crank it up a bit...if not, move it a little closer. Small increments like you just did is good, just keep an eye on your plants over the next 24hrs.