A miniature ion thruster has been proposed in recent years for a small propulsion system applied in space missions such as deep space exploration, precise high-stability attitude and position control. An electron cyclotron resonance (ECR) ion thruster is free from contamination and degradation of electron emission capacity and will offer a potentially longer thruster lifetime than that in the electron bombardment type. The microwave ECR ion source with a 20-mm diameter designed here consists of two annular permanent magnets (SmCo), ring coupling antenna and a grid system including screen and acceleration. For the ion source performance optimization, with a fixed magnetic structure, the antenna position and cavity length in the discharge chamber can be adjusted to strengthen electron ECR heating and increase ion beam extraction. According to the distribution of static magnetic field and the ECR layer measured by Gauss meter, three possible sizes of antenna position (L1) are set; depending on the cut-off characteristics of the discharge chamber and the distribution of microwave electric field calculated by finite element method, six candidate sizes of cavity length (L2) are set. By comparing the difference in plasma discharge and ion beam extraction, the optimal structure of ion source can be obtained. Experimental results show that for a given antenna position, there is a cavity length not too long or too short to extract the maximum ion beam. And the launch of microwave from strong magnetic field near ECR layer is conductive to lossless wave propagation in plasma and highly efficient electron ECR heating. To maintain a plasma in very low power and flow, the size combination of 0.6-mm in L1 and 5-mm in L2 is selected as the preferred structure. The performances of miniature ECR ion source, that is, ion beam current, discharge loss, propellant utilization efficiency, thrust and specific impulse are 5.4 mA, 389 W/A, 15%, 163 μup N and 1051 s, respectively, at an incident power of 2.1 W and argon flow of 14.9 μg/s.