Zeolite imidazole framework-8 (ZIF-8), with porous structure and pH sensitivity, is an ideal stimulus-response nanocarrier for delivering molecules. Choosing the appropriate synthesis conditions for achieving the accessible porosity volume is the main challenge in creating ZIF-8. This study synthesized new micro-mesoporous ZIF-8 nanoparticles with a 3.11 nm pore size using an ultrasonic bath in a methanol-dimethylformamide mixed solvent. The response surface methodology was used to explore the impact of the synthesis environments. It was found that the optimized conditions were 8.38 ligand-to-metal ion ratio, 100 % power, 64 min, and 6.11 methanol/dimethylformamide. The optimized particles loaded with a corrosion inhibitor, 2-mercaptobenzothiazole, demonstrated a faster inhibitor release in acidic pHs due to the breakdown of the ZIF-8 structure. This research concluded that blending solvents with varying strengths can yield superior physicochemical properties, facilitating micro-mesoporous ZIF-8 production with high pore volume. This discovery holds promise for producing ZIF-8-based materials that benefit various applications.