目前的网络服务器大多为C/S架构,其线程响应客户端要么短且频繁,要么长而连续,这两种服务请求均要求服务器根据系统负载提供稳定的响应时间,并在高并发情况下保证服务器系统的工作稳定性。传统的多线程技术虽能通过并发服务器发挥较好的性能,但线程频繁的创建与销毁会导致巨大的系统开销。为此,在研究线程池技术机理的基础上,针对常见的线程池容量估算的弊端,提出了经优化的池线程容量估算方法。该方法引入经优化的池线程,以解决因大量客户端服务请求所导致的服务器不稳定问题。线程池性能测试与验证结果表明,采用所提出的线程池容量估算方法和线程池策略,有效地降低了因频繁创建线程而导致的系统开销,既保证了高负载条件下服务器的稳定性,又能够为服务器提供稳定的吞吐量。
Network servers often use C/S architecture as the main framework currently. The server needs to create a thread frequently in response to a client short or long and continuous service requests. Each type of server requests are required to be able to provide a stable system load according to the response time for the request and guarantee the stability of the server system under the high concurrency. Tra- ditional multi-threading technology can provide excellent performance in the concurrent server,but can lead to huge system overhead be- cause of its frequent thread creation and destruction. An optimization method for estimating the capacity has been proposed according to the disadvantages of common thread pool capacity estimation so as to improve the thread pool server performance, in which the introduc- tion of the thread pool is employed to solve the instability because of a large number of client request thread creation and destruction cau- sing borderless. Thread pool performance testing and verification results show that thread pool takes a more excellent concurrency control strategy and has provided the stable throughput for the server.