Teach you how to calculate the maximum load of the WEB server

  
                  

Dynamic feedback load balancing algorithm considers the real-time load and response of the server, and constantly adjusts the proportion of requests processed between servers to avoid some servers still receiving a large number of requests when overloaded, thereby improving the throughput of the entire system. Figure 1 shows the working environment of the algorithm, running the Monitor Daemon process on the load scheduler, Monitor Daemon to monitor and collect the load information of each server. The Monitor Daemon calculates a combined load value based on multiple load information.

Monitor Daemon calculates a new set of weights for the combined load value and current weight of each server. If the difference between the new weight and the current weight is greater than the set threshold, Monitor Daemon will use the server. The weight is set to the IPVS scheduling in the kernel, and the connection scheduling in the kernel generally uses a weighted round-robin scheduling algorithm or a weighted minimum connection scheduling algorithm.


Figure 1: Working environment of dynamic feedback load balancing algorithm

Connection scheduling

When a client accesses network access through a TCP connection, the service needs The time and computing resources to be consumed vary widely and depend on many factors. For example, it depends on the type of service being requested, the current network bandwidth, and the current utilization of server resources. Some heavily loaded requests require computationally intensive queries, database access, and long response data streams; while lightly loaded requests often require only one HTML page to be read or a very simple calculation.

The difference in request processing time can cause the server to use the skew (Skew), which is the load imbalance between servers. For example, there is a WEB page with A, B, C, and D files, where D is a large image file, and the browser needs to establish four connections to fetch those files. When multiple users access the page simultaneously through the browser, the most extreme case is that all D file requests are sent to the same server.

So, there may be situations where some servers are already overloaded and other servers are basically idle. At the same time, some servers are too busy to have a long queue of requests and are constantly receiving new requests. Conversely, this will cause the customer to wait for a long time and feel that the system's service quality is poor.

Simple Connection Scheduling

Simple connection scheduling can cause server skew to occur. In the above example, if a round-robin scheduling algorithm is used and there are exactly four servers in the cluster, one server must always receive a D-file request. This scheduling strategy results in low utilization of the entire system resources, because some resources are exhausted and the customer waits for a long time while other resources are idle.

Characteristics of actual TCP/IP traffic

The literature shows that network traffic is wavy. After a long period of small traffic, there will be a large flow of access, then Small flow, which happens like a wave periodically. The literature reveals that there is a self-similarity of network traffic on WAN and LAN, and there is also self-similarity in WEB access flow. This requires a dynamic feedback mechanism that takes advantage of the state of the server group to handle the self-similarity of the access stream.

Copyright © Windows knowledge All Rights Reserved