Web Application Server Optimization method
In the optimization of the Web server, it is necessary to optimize the scheme according to the situation and characteristics of the real Web application system. First, according to the different network characteristics: In the LAN, reduce m T U (maximum transmission unit) value pairs can avoid copying data and check, and by optimizing the select system call or in the socket event handler to perform the calculation can optimize request concurrency management, using HTTP1. 1 continuous connection and so on can improve the performance of the system, but in the WAN environment, there is no big role, and some even the opposite.
For example, reducing the MTU of a user connection increases server processing overhead, using network latency, bandwidth throttling, and using HTTP1. A 1 continuous connection does not have any significant impact on server performance in the WAN. In a wide area network, the waiting time for an end user's request depends on the degree of latency associated with it, and the connection bandwidth limit. For a wide area network, soft and hard interrupts take a large part in the processing of networks, so adopting an adaptive interrupt processing mechanism will bring great benefits to the responsiveness of the server. Locating the server in the kernel and changing the process based design to transaction based processing can also improve server performance to varying degrees.
With regard to web load, in addition to analyzing the characteristics of the web load to better reproduce the real load during the evaluation, consider the load in the network environment where the Web server resides. People not only require the server to meet the normal workload requirements, but also maintain high throughput during the peak period. However, the performance of servers in high load situations is often lower than people expect.
Server overload is divided into two types: an instantaneous overload, that is, the server temporary, short time overload, this situation is mainly caused by the characteristics of the server load. A large number of studies have shown that the network traffic distribution of Web Requests is self-similar, that is, the traffic of Web requests can be significantly changed in a large range. This causes the server to overload over a short period of time, but this is usually a short duration. One is that the server is overloaded for a long time, which is typically caused by a particular event, such as a denial-of-service attack or a "live lock" phenomenon.
The first type of server overload is unavoidable, but the second scenario can be improved by improving the server. Aside from malicious attacks, careful analysis of the process of server processing information packets can be found that the system in the overload situation, the root cause of performance degradation is the high priority processing stage of the CPU unfair preemption.
Therefore, if you limit the CPU occupancy rate in the high priority processing stage or limit the number of high priority CPUs, you can reduce or eliminate the live lock phenomenon. The following methods can be used in detail:
First, the use of polling mechanism. In order to reduce the impact of interruption on system performance, the "lower half" method is very effective in the case of normal load, while in the case of high load, this method will still cause the active lock phenomenon, then the polling mechanism can be used. Although this method can cause waste of resources and decrease of response speed when the load is normal, it is more effective than interrupt-driven technology when the network data arrives at the server frequently.
Second, reduce context switching. This approach can be achieved by introducing a core-level (KERNE1-LEVE1) or hardware-level data stream, regardless of the circumstances in which the server is effective for performance improvement. The core-level data flow is the forwarding of data from the source through the system bus without requiring the data to pass through the application process, because the data is in memory, so CPU manipulation data is required.
Hardware-level data flow is the data from the source through the private bus or DMA through the system bus forwarding without the need to make the data through the application process, this process does not require CPU operation data. In this way, the user thread is not required to be involved in the data transmission, the number of copies is reduced and the cost of context switching is reduced.
Third, reduce the frequency of interruption (mainly for the high load of the method). There are two main ways of doing this: batch interrupts and temporary shutdown interrupts. Batch interrupts can effectively suppress the live lock while overloading, but there is no fundamental improvement to the performance of the server; When the system appears to receive live locks, you can use a temporary shutdown to ease the burden of the system, when the system cache can be again available to open the interrupt, However, this method can cause packet loss if the receiving cache is not large enough.
Web server performance is the key link of the whole web system, and improving the performance of Web server is a topic that people have been paying close attention to for a long time. By analyzing the working principle of the Web server and the existing optimization methods and techniques, the paper concludes that the improvement of the performance of the Web server should be analyzed concretely, and the corresponding optimization measures should be taken according to its characteristics in the specific application environment.
please contact the site, timely note your name. Contact Email: edu#chinaz.com (change # to @).