To solve the load skew problem caused by the built-in load balancing algorithm of Nginx, this paper proposes an improved dynamic load balancing algorithm based on weighted polling. The algorithm monitors the actual load of the background server and adjusts the weight dynamically to achieve load balancing. Firstly, the indicators such as CPU usage and memory usage are collected periodically, and the number of connections and the number of processes are introduced as statistical load factors. The connection number weight and the number of processes weight are calculated according to the connection number and the number of processes. Finally, the three weights are added together to adjust the server weight. The performance of other algorithms built in Nginx is compared with the algorithm proposed in this paper. The results show that the dynamic algorithm proposed in this paper has higher actual concurrency and lower average response time under high concurrent requests, and can better achieve load balancing and improve the performance of the server cluster.