| Existing servers do not adequately achieve the flexible ability of increasing synchronously following with the load, which must support extreme concurrency.So it causes the quality of service to decline badly.Because of this, the staged event-driven mode is suggested to handle the massive concurrency,through analyzing and comparing different internal architectures of network servers. The staged asynchronous event-driven mode is based on event-driven mode, which is mixed with threads mode to deal with massive concurrency. In this mode, servers are constructed as a network of event-driven stages, each stage is collocated with a dynamic threads pool to deal with subsequent events, and stages communicate with each other through events queues.This dissertation provides the application of the staged asynchronous event-driven mode. We design and implement the Web server base on the staged asynchronous event-driven mode. According to working principle of Web server,this server is divided into seven stages: connection accepting,Cache checking,Cache missing,response sending,reading,writing,file I/O. On resource management, each stage is connected with relevant event queues which controllers are adopted to observe, it automatically adapts the use of resource based on observed performance and demand by controllers. On Cache management, the adaptive Cache technology is suggested. According to the size of resources, which bigger than threshold are removed based on LRU, this implements efficient pages management.Moreover, this server adopts the non-blocking sockets provided by JDK1.5 to implement asynchronous communication of reading and writing stages. According to the function and performance test, it shows that this Web server has the better ability to handle massive concurrency and achieves high performance. |