By establishing a three-dimensional mathematical model based on the physical characteristics of the steam ejector and utilizing computational fluid dynamics (CFD) method, this study conducted three-dimensional numerical simulations to investigate the effects of five key structural parameters, namely, the length of the nozzle diffuser section, the diameter of the nozzle outlet, the length of the contraction section in the mixing chamber, the diameter of the mixing chamber inlet, and the length of the mixing chamber throat, on the ejector performance under identical operating conditions. By fitting 50 sets of simulation data using the least squares method, analytical expressions for these structural parameters in terms of the ejection coefficient μ were obtained. Subsequently, an improved firefly algorithm was employed to identify the optimal combination of structural parameters, followed by simulation verification. The results showed that compared to the single-factor sensitivity analysis method, the improved firefly algorithm obtained a superior combination of structural parameters, resulting in a 2.03% enhancement in the ejection performance of the steam ejector.