To improve warship formation sustainability and reduce stock cost for spare parts, warship formation mission reliability evaluation model with the spare parts concept is established after analyzing warship formation mission. The stock cost for spare parts is taken as the optimization object and warship formation mission reliability is used as the restriction. Based on margin analysis method, the computation method for spare parts optimization is provided. Finally, a warship formation cruising mission is taken for example and spare parts optimization concept on board is given based on the method. The optimization results are coincident with the military practice case by analyzing. That can help materiel support commander make decision.