The invention provides a TCP long connection
server automatic expansion method and
system. The method comprises the following steps: acquiring and monitoring various load indexes of a
server in real time; receiving and analyzing the real-time load data, and judging whether resources need to be expanded or reduced currently according to a preset threshold value; based on the
current load trend and historical data, performing short-term load prediction by adopting an extended decision
algorithm; when expansion or reduction conditions are met, expansion or reduction operation is started, and a capacity expansion and reduction decision instruction is output; configuring a plurality of load balancing strategies, and distributing the received TCP long connection request to each service instance; and dynamically adjusting the size of a
connection pool in the TCP long connection service cluster according to the
system load condition and the capacity expansion and contraction decision instruction, and executing TCP connection load balancing operation after resource expansion or reduction. According to the invention, dynamic adjustment of resources is realized through technical means of load monitoring, automatic expansion, load balancing, dynamic
connection management and the like, so as to meet service requirements under different load conditions.