In the modern manufacturing environment, the production systems develop towards a flexible direction due to increasing of the market demands of multiple varieties and small batch-based customized products. In order to make better use of existing resources and improve production efficiency, real-time performance evaluation and prediction of real-time scheduling and optimization improvement based on small batch production have important research significance in distributed flexible production system. This paper mainly studies the performance analysis of multi-batch serial production lines based on degenerate machines, and carries out task scheduling and predictive maintenance for distributed production system. Specifically, for the machines with degradation models and the production system with limited buffer capacity, the mathematical model is firstly established by Markov analysis method. Then, an accurate analysis method is proposed to calculate the real-time performance indicators of the evaluation system, and a genetic algorithm based on the model is proposed to solve the scheduling problem. In addition, a predictive maintenance strategy is proposed to reduce the completion time for machines with degradation models. Finally, the feasibility and effectiveness of the mathematical model and algorithm are illustrated by numerical experiments.