We study the partial and total pressures of the mixed gases in a Rb vapor cell from its absorption spectrum under the influence of natural broadening, self-broadening, pressure broadening, the pressure shift, and Doppler broadening. A comprehensive model of the absorption coefficient on the Rb D2 line is developed, which takes into account the influence of multiple gas species. The importance of light intensity selection and frequency calibration to obtain accurate experimental results are discussed. Accurate abundances are deduced from the experimentally measured absorption spectra of vacuum cells and are used to optimize the abundance parameters in our model. We fit the experimentally measured absorption spectrum of a gas-filled cell to the optimized model and obtain a root mean square error better than 0.1%. The extracted partial pressures indicate that the mixture ratio agrees well with the designed value, while the total pressure has an increment of about 17% of its nominal value. We further estimate the amount of helium leakage in a cell to be 89.1 Torr for 6 months. Moreover, using a series of absorption spectra generated by our model as benchmarks, we evaluate the effectiveness of the commonly used single and double Lorentzian fitting models and give some suggestions for using the double Lorentzian model. This study provides a reference for designing the appropriate gas mixture for comagnetometer systems.