The influence of some cavity parameters on the resonance frequency and quality factor is investigated with the aim of comparing various methods of optimization. As an example, the geometry of the designed resonator for an experiment on a multifrequency gyrotron that would operate at 140 GHz in the TE 22,8 mode is considered. This is a weakly-tapered conventional cavity resonator with parabolicroundings. The influence of the roundings on the quality factor is at least as important as that of the cavity length and the output taper angle.