We study the gauge cooling technique for the complex Langevin method applied to the computation in lattice quantum chromodynamics. We propose a new solver of the minimization problem that optimizes the gauge, which does not include any parameter in each iteration, and shows better performance than the classical gradient descent method especially when the lattice size is large. Two numerical tests are carried out to show the effectiveness of the new algorithm.