Sex allocation is defined as the allocation of resources to produce male and female offspring during reproduction, and it is an important topic in evolutionary biology. As organisms with special haplo-diploid sex determination, parasitoid wasps are particularly suited for the study of sex allocation. However, most studies focused on the secondary sex ratio (i.e., the eclosion sex ratio) because the oviposition ratio (the primary sex ratio) is difficult to study, especially in parasitoid species. The primary sex ratio may differ from the secondary sex ratio due to larval mortality and self-superparasitism.The present study used microsatellites to explore the effects of female age on the primary and secondary sex ratio (male proportion) of the solitary ectoparasitoid Pachycrepoideus vindemmiae (Rondani) (Hymenoptera: Pteromalidae). The primary sex ratio showed a significant decreasing trend as the oviposition days increased, and the secondary sex ratio significantly increased. Self-superparasitism, i.e., laying more than one egg in a host, was the cause of the variation in the secondary sex ratio in P. vindemmiae. When females practiced self-superparasitism, they tended to lay female eggs. The application of microsatellites helped explore and improve the understanding of the primary sex ratio and self-superparasitism in this ectoparasitoid species.