In this paper, the influence of packaging on the high speed performance of photodetector (PD) is systematically and comprehensively studied. Combined with the equivalent circuit, the RF attenuation induced by packaging in PD module is investigated in detail. The microwave transmission performance of the PD module has been analyzed and optimized in three regions: the RF substrate, the connection between the coaxial connector and the substrate, and the parasitic parameters introduced by packaging. With the optimized scheme, a packaged PD module with a 3dB bandwidth of 23GHz is fabricated and its bandwidth has no degradation compared to the photodiode chip. The results indicate that the performance of the PD module can be compensated by optimizing the packaging design and the optimized scheme can be used for PD module which has a higher response speed.