In P2P networks, content delivery is very critical, but there are not many relevant research results. In this paper, in order to simulate content delivery in P2P mode, online players are abstracted as servers that can provide services, the peers write content to buffer is abstracted as the customers' arrival, and the players read content from buffer is abstracted as the service process of the servers. An M/M/c queueing model with random variation in the number of servers is developed considering the influence of the number of P2P online servers on energy consumption, and negative customer and preemptive priority policies are introduced. The matrix-geometric solution method was used to derive performance measures for two types of customer, such as average queue length and average delay in the steady state of the system. And use Matlab to give some numerical examples to analyze the trend of performance measures with parameters in P2P networks. The benefit function is established to obtain the parameter values that make the social benefit optimal by Nash equilibrium and social optimal strategy.