CN111277629A - High-availability-based web high-concurrency system and method - Google Patents

High-availability-based web high-concurrency system and method Download PDF

Info

Publication number
CN111277629A
CN111277629A CN202010030614.XA CN202010030614A CN111277629A CN 111277629 A CN111277629 A CN 111277629A CN 202010030614 A CN202010030614 A CN 202010030614A CN 111277629 A CN111277629 A CN 111277629A
Authority
CN
China
Prior art keywords
server
web
cluster
load balancer
performance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010030614.XA
Other languages
Chinese (zh)
Inventor
孟利民
王斌
应颂翔
蒋维
林梦嫚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202010030614.XA priority Critical patent/CN111277629A/en
Publication of CN111277629A publication Critical patent/CN111277629A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

A high-availability-based web high-concurrency system comprises a load balancer cluster adopting a high-availability scheme, a dynamic and static separated web server cluster and a database server containing session sharing, wherein the load balancer cluster comprises a main load balancer and a plurality of additional high-availability standby load balancers; the web server cluster is realized by adopting a mode of matching Nginx + Tomcat; the database server comprises a hard disk database Mysql and a Memcached memory database for realizing session sharing. And to provide a high-availability based web high-concurrency approach. The invention improves the processing capacity of the web system when dealing with high concurrent events, can reasonably schedule system server resources when different work request types are adopted, shortens the average response time of the client and improves the overall throughput of the server.

Description

High-availability-based web high-concurrency system and method
Technical Field
The invention is based on the most widely applied world wide Web application on the Internet at present, and particularly designs a system and a method for solving the high concurrency of a Web server.
Background
With the improvement of the basic implementation of the internet and the increasing of mobile terminals, the internet services are more and more abundant, and the number of users is more and more large. On one hand, the social, media, shopping and other web sites are getting larger, for example, the current concurrent access needs are large, such as e-commerce sites, related famous search engines, etc., and the daily concurrent access amount and the peak access amount are hard to imagine. On the other hand, in some promotion activities, holiday ticket buying activities and other activities, the impact of peak flow puts higher requirements on the concurrence performance of the web system website.
On the peak date of ticket buying during the spring festival of each year, the 12306 platform is used as an official train ticket buying platform, but the problems of server jamming, breakdown and the like frequently occur, which is very unfriendly for the user experience. This illustrates that as the number of users and the size of data grows, conventional web system architectures have been unable to meet current needs, which presents new challenges to the ability of web systems to handle high concurrency.
Nginx is used as a high-performance load balancer, all requests reach Nginx, the load balancer is located at a very important position, and if a Nginx server is down, a back-end web server cannot provide services, so that the influence is serious. But in the face of ticket buying peak hours such as 12306 platform, only one or a few load balancers are not enough, and thus a load balancer cluster needs to be constructed. At this time, the load balancer cluster needs to adopt a high availability scheme to ensure the mutual communication among the cluster servers, once the main load balancer has a problem, the standby load balancer needs to take over to be the main load balancer, so that one load balancer is always in a normal working state to realize the continuity of the service, and the load balancer cluster realizes high availability.
Disclosure of Invention
Aiming at the problems, the high-concurrency web system architecture is designed and realized from the aspects of high availability, dynamic load balancing algorithm, session sharing and the like based on the load balancer cluster of the high-availability module. The functions of high concurrency of the web system, improvement of the utilization balance rate of system resources and the like can be realized. The method has certain practical value for the high-availability specific application research and the design of a high-concurrency system architecture.
The purpose of the invention can be realized by the following technical scheme:
a high-availability-based web high-concurrency system comprises a load balancer cluster adopting a high-availability scheme, a dynamic and static separated web server cluster and a database server containing session sharing;
the load balancer cluster comprises a main load balancer and a plurality of added high-availability standby load balancers, and the main load balancer and the standby load balancers form the high-availability cluster so as to prevent a single-point fault of a load balancing module;
the high availability scheme is realized by adopting Keepalived, and the Keepalived configuration is relatively simple, is easy to realize and is convenient to manage and test;
keepalived is a specific implementation of Virtual Routing Redundancy Protocol (VRRP) that can address single point failures of static link routing. When the Keepalived node works, the main node sends a packet, the standby node receives the packet, when the standby node cannot receive the data packet sent by the main node, a receiving program is started to receive the resources of the main node, a plurality of standby nodes can be provided, and the standby nodes are selected to become the main node through priority. The Keepalived high-availability pairs communicate through the VRRP, when the system works, the main server can acquire all resources, constantly broadcast the VRRP packet and inform the standby server of the health state of the main server, and when the main server is unavailable, related services are started to take over the resources so as to ensure the continuity of the service;
when the main load balancer master is in a normal working state, the backup load balancer is in a dormant state temporarily, meanwhile, the health state of the main load balancer master is monitored continuously, once the main load balancer master is found to be abnormal, namely the backup balancer is considered to be down when a VRRP packet is not received, all resources of the main load balancer need to be taken over immediately at the moment, one backup as the master can be selected according to the priority of VRRP, and the configuration of the backup load balancer is generally consistent with that of the main load balancer in order to be capable of taking over service effectively;
keepalived has three major modules, core, check and vrrp. The core module is a kernel of keepalive and is responsible for starting and maintaining a main process and loading and analyzing a global configuration file, and the check is responsible for health check and comprises various common check modes. The VRRP module is used for realizing the VRRP protocol;
the load balancing cluster is the foremost part of the system, the load balancing module is realized by adopting Nginx to carry out reverse proxy, and a dynamic load balancing algorithm is adopted to forward the client request, so that the back-end servers can better cooperatively process the user request;
the dynamic load balancing module calculates the dynamic weight of the web service cluster in real time by adopting weighted summation according to the specific type of the working load and the performance monitoring data of the web cluster, so as to realize reasonable forwarding and efficient processing of the flow;
the performance index data of the web cluster is collected through monitoring, and performance data indexes of a cpu, an internal memory, an IO, a network and the like of the web server are mainly monitored. The specific performance index data is defined as follows:
(1)cpuirepresenting the CPU availability performance of the web server, CPU _ limit representing the maximum available core number of the web server, CPU _ freq representing CPU main frequency, and CPU _ utilization representing CPU real-time utilization, wherein the formula is defined as follows:
Figure BDA0002364154820000041
(2)memithe method comprises the following steps of representing the available performance of a web server memory, representing the maximum available memory of the web server by mem _ limit, representing the memory frequency by mem _ freq, representing the real-time utilization rate of the memory by mem _ utilization, and defining a formula as follows:
Figure BDA0002364154820000042
(3)fsiindicating the web server hard disk availability, fs _ read _ speed, fs _ write _ speed, fs _ optimization, and real-time utilization of the hard disk, wherein the formula is defined as follows:
Figure BDA0002364154820000043
(4)netithe method comprises the steps of representing the network transceiving speed of a web server, representing the network communication state of a current server, representing the receiving speed of the network flow of the server by net _ receive _ speed, and representing the sending speed of the network flow of the server by net _ transmit _ speed;
neti=net_receive_speed+net_tranmit_speed
assuming that the number of web server clusters is N, the ith web server performance indicator parameter may be defined as follows:
Pi=[cpui,memi,fsi,neti]
when each period starts, calculating a load value, and P is the threshold value when only one of the four hardware occupancy rates reaches the threshold valueiAnd if not, sequentially calculating four performance index values. If all three occupancy rates of a certain server are 0, then it is down, PiAt 0, the request will not reach this server until normal is restored.
In order to eliminate the influence of different dimensions on the weighted summation, a normalization method is adopted to process cpu, memory, hard disk and network index data, and the normalization data is as follows:
Pi'=[cpui',memi',fsi',neti']
cpui' denotes a normalized web server cpu real-time performance index, the larger the value of which denotes the better the current server cpu performance.
Figure BDA0002364154820000051
memi' indicating the real-time performance index of the memory of the normalized web server, the larger the value of the index, the better the performance of the memory of the current server。
Figure BDA0002364154820000052
fsi' denotes the real-time performance index of the normalized web server hard disk, and the larger the value of the index is, the better the performance of the current server hard disk is.
Figure BDA0002364154820000053
neti' denotes a normalized web server network real-time performance indicator, with a larger value indicating better current server network communication performance.
Figure BDA0002364154820000061
Setting the weight of the corresponding index according to the corresponding performance monitoring data:
K=[Kc,Km,Kf,Kn]wherein Kc+Km+Kf+Kn=1
The weight of the corresponding performance index can be set according to the characteristics of the working load, so that the load weight of the web server cluster is dynamically adjusted, the flow is reasonably forwarded to the optimal web server, the concurrent processing performance of the system is improved, and the working load of the web system can be divided into the following three types according to the difference of specific special service scenes:
(1) cpu intensive: a large amount of calculation is required to consume cpu resources, for example, high-definition decoding of resources such as videos, data analysis and calculation of social networking sites, and the like are performed. At this time, the specific gravity of the cpu and the memory should be increased appropriately, so that a large number of requests can be forwarded to the server with sufficient cpu and memory for operation.
(2) IO intensive: a large number of IO operations, such as network data transmission, frequent database operations, etc., are required. At this time, the network and IO weight should be increased appropriately to ensure that a large number of requests can be forwarded to a server with sufficient IO resources.
(3) Response time type: most online websites pay attention to user experience and require a high response speed of the system. At this time, all factors can be considered, and the request is forwarded to the server with better average system performance to be executed as much as possible, so that the performance such as the response time of the system is ensured.
Real-time dynamic weights W with weight summation web serveriThe calculation is as follows:
Wi=Pi'×KT
the overall dynamic weight W of the web server cluster is:
W=P×KT=[P1',P2',...,P′N]×KT
the dynamic load balancing algorithm can distribute corresponding weights according to the working load characteristics and periodically and dynamically calculate the dynamic weights of the web server cluster according to the web server index data collected in real time, and then the load balancer dynamically loads the dynamic weights so as to realize the dynamic load balancing of the cluster.
The dynamic load balancing realizes the functions of registering and discovering the dynamic load balancing by using Consul, realizes that the Nginx server dynamically acquires the latest upstream list by using Upsync, and reads the configuration information in real time after the Nginx configuration information is modified each time, thereby avoiding the redundant step of restarting the Nginx configuration information after the Nginx configuration information is modified.
Consul uses a Raft algorithm to achieve cluster data consistency, and Upsync is a three-party module for achieving dynamic configuration based on Nginx and used for sourcing of Xinlang microblogs. The function of the Nginx-Upsync-Module is to pull the list of the backend servers of Consul and dynamically update the routing information of the Nginx. This module is not dependent on any third party module. Consul as the DB for Nginx, uses the KV service of Consul to pull the configuration of each upstream and update the route of each upstream independently for each Nginx Work process.
The Web server cluster is realized by adopting a mode of matching Nginx + Tomcat, Nginx processes multi-user concurrent requests based on an event-driven model, has incomparable advantages in the aspect of processing static resources, and has expansibility and stability, so that Nginx is used as a Web server to process the static resources. Since Tomcat has good scalability and security in handling dynamic resources, Tomcat is used as a Web server to handle dynamic resources. The web server cluster is realized by configuring different ports.
The database server comprises a hard disk database Mysql and a Memcached memory database for realizing session sharing.
The session sharing is to maintain the consistency of session data among a plurality of nodes of the cluster, and the session sharing based on the memcached cache is adopted. Even if the cacheDB is used for storing the session information, the back-end server receives a new request and stores the session information in the cacheDB, when the back-end server fails, the scheduler can search for an available node and distribute the request in a traversing manner, when the application server finds that the session is not in the memory of the local machine, the application server searches in the cacheDB, and if the session is found, the session is copied to the local machine, so that the session sharing and high availability are realized.
The session is stored by using memcached, the sessions of a plurality of tomcats are managed in a centralized mode, and the front end utilizes nginx load balancing and dynamic and static resource separation, so that the system level expansion is considered, and meanwhile, the higher performance can be guaranteed. Namely, the Session of Tomcat is serialized by an MSM tool and then stored in Memcached, thereby realizing Session sharing.
Because the web server cluster has a plurality of Tomcat servers, a Non-Sticky Session mode is adopted, when a Request comes, a standby Session is loaded to Tomcat from Memcached2, when the Request ends, the Tomcat Session is updated to a main Memcached1 and a standby Memcached2, and the Tomcat Session is cleared, so that the purpose of main-standby synchronization is achieved, and a Non-Sticky mode is required to be selected when the plurality of Tomcat clusters are arranged, namely, the Sticky is "false".
A web high-concurrency access processing method comprises the following steps:
s1, when the load balancer receives the client request, the resource types of the user request are classified, the static resource is processed by the static resource server, the load balancer carries out forward proxy, the URL _ HASH algorithm is adopted, meanwhile, the static resource server is added with cache, so that the response speed of the back-end server is greatly improved;
s2, when the request is a dynamic resource, the load balancer carries out reverse proxy, dynamically adjusts the upstream list of the Nginx server through a dynamic load balancing algorithm, and hands the user request to the dynamic resource server for processing;
s3, the load balancer cluster adopts Keepalive to ensure that one main load balancer is always in a normal working state;
s4, the dynamic resource server cluster obtains database data through interaction with the hard disk database Mysql, and session data are shared through the memory database Memcached.
The invention has the beneficial effects that:
(1) the load balancer cluster adopts a high-availability strategy, and when the load balancer has a single-point fault, a standby machine with the same function always takes over resources, so that the service continuity is ensured.
(2) The new dynamic load balancing algorithm can distribute corresponding weight according to the working load characteristics and dynamically calculate the dynamic weight of the cluster according to the collected real-time performance data of the web server, and then the load balancer loads the dynamic weight so as to realize reasonable resource distribution of the web server cluster.
(3) And the nginx configuration information is modified every time, the restarting is not needed, and the nginx reads the configuration information in real time.
(4) Under the tomcat cluster environment, the session is synchronized among a plurality of application servers, so that the session is kept consistent, and the hidden danger caused by the fact that the ip _ hash algorithm sends the same user request to a fixed back-end server is solved.
Drawings
FIG. 1 is a system framework diagram of the load balancer cluster, static resource server cluster, dynamic resource server cluster, and database server cluster of the present invention.
Fig. 2 is a flow of a high availability scheme for a cluster of load balancers.
FIG. 3 is a flow diagram of a dynamic load balancing algorithm based on workload characteristics.
Fig. 4 is a schematic diagram of a dynamic resource server sharing session through a Memcached database.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1 to 4, a high-availability web high-concurrency system, as shown in fig. 1, includes a load balancer cluster adopting a high-availability scheme, a dynamically and statically separated web server cluster, and a database server including session sharing;
the load balancer cluster comprises a main load balancer, and a plurality of high-availability standby load balancers are added to form a high-availability cluster so as to prevent a single point of failure of a load balancing module.
The high availability scheme, as shown in fig. 2, is implemented using Keepalived, because Keepalived configuration is relatively simple, easy to implement, and convenient to manage and test. The main server sends a multicast packet to all the standby servers by using a VRRP protocol so as to inform the health status of the standby servers. And once the standby server cannot receive the multicast packet, the standby server considers that the main server is abnormal and replaces the standby server to be the new main server to continue to complete the work.
The dynamic load balancing algorithm is used for calculating the dynamic weight of the web service cluster in real time by adopting weighted summation according to the specific type of the working load and the performance monitoring data of the web cluster, so that the reasonable forwarding and the efficient processing of the flow are realized.
The dynamic load balancing realizes the functions of registering and discovering the dynamic load balancing by using Consul, realizes that the Nginx server dynamically acquires the latest upstream list by using Upsync, and reads the configuration information in real time after the Nginx configuration information is modified each time, thereby avoiding the redundant step of restarting the Nginx configuration information after the Nginx configuration information is modified.
The Web server cluster is realized by adopting a mode of matching Nginx + Tomcat, Nginx processes multi-user concurrent requests based on an event-driven model, has incomparable advantages in the aspect of processing static resources, and has expansibility and stability, so that Nginx is used as a Web server to process the static resources. Since Tomcat has good scalability and security in handling dynamic resources, Tomcat is used as a Web server to handle dynamic resources. The web server cluster is realized by configuring different ports.
The database server comprises a hard disk database Mysql and a Memcached memory database for realizing session sharing.
The session sharing is, as shown in fig. 4, to maintain consistency of session data among a plurality of nodes of a cluster, where session sharing based on a memcached cache is adopted.
A high-availability based web high-concurrency method comprises the following steps:
s1, when the user request type is static resource, forward proxy is carried out through a load balancer, the request is distributed according to the hash result of the website of the access request by adopting a url _ hash algorithm, different urls point to different servers, and meanwhile, a cache is added in the static resource server, so that the response speed of the back-end server is greatly improved. The static resources are generally designed html pages, and the static resources do not need to participate in program processing with a database;
and S2, when the request is a dynamic resource, the load balancer carries out reverse proxy, dynamically adjusts the upstream list of the Nginx server through a dynamic load balancing algorithm based on the characteristics of the working load, and hands the user request to the dynamic resource server for processing. The general dynamic resource generally firstly submits a request to a web server, the web server is connected with a database, after the database processes data, the content is delivered to the web server, and the web server returns to a client for analysis and rendering processing;
s3: the load balancer cluster adopts Keepalive to ensure that one main load balancer is always in a normal working state;
s4: the dynamic resource server cluster obtains database data through interaction with a hard disk database Mysql, and session data are shared through a memory database Memcached.
The dynamic load balancing algorithm in step S2, whose flow is shown in fig. 3, may allocate corresponding weights according to the working load characteristics and periodically and dynamically calculate the dynamic weights of the web server cluster according to the web server index data collected in real time, and then dynamically load the dynamic weights by the load balancer to implement the dynamic load balancing of the cluster.
The performance index data of the web cluster is collected through monitoring, and performance data indexes of a cpu, an internal memory, an IO, a network and the like of the web server are mainly monitored.
The weight of the corresponding performance index can be set according to the characteristics of the working load, so that the load weight of the web server cluster is dynamically adjusted, the flow is reasonably forwarded to the optimal web server, and the concurrent processing performance of the system is improved. In general, web system workloads can be classified into three types according to different specific special service scenarios: cpu intensive, IO intensive, response time intensive.
The specific implementation steps of the algorithm are as follows:
(1) initializing Nginx servers, initializing performance indexes of the servers, and writing the performance indexes into configuration information;
(2) judging whether a certain performance index of a server reaches a specified threshold value, if so, setting the server as unavailable and repeating the step 1, otherwise, continuing the next step;
(3) starting to receive a client request and judge the load type of the request, setting the weight of a corresponding performance index according to the load characteristic of the request, and then distributing a web server according to the calculation result to process the request;
(4) and judging whether the server starts processing after the request is forwarded, if so, feeding the request back to the corresponding client by the back-end server after the request is processed, otherwise, setting a corresponding flag bit, and making the server unavailable when the server is down. And judging whether all servers are down, if so, finishing the process, and otherwise, carrying out load balancing calculation again and distributing new server processing requests.

Claims (7)

1. A high-availability based web high-concurrency system, characterized by: the web high concurrency system comprises a load balancer cluster adopting a high availability scheme, a web server cluster with dynamic and static separation and a database server containing session sharing;
the load balancer cluster comprises a main load balancer and a plurality of added high-availability standby load balancers, and the main load balancer and the standby load balancers form the high-availability cluster so as to prevent a single-point fault of a load balancing module;
the high availability scheme is realized by adopting Keepalived, because the Keepalived configuration is relatively simple, the realization is easy, and the management and the test are convenient, the main server sends the multicast packets to all the standby servers by utilizing a VRRP protocol to inform the health state of the standby servers, once the standby servers cannot receive the multicast packets, the main server is considered to be abnormal, and the main server is replaced into a new main server to continue to complete the work;
the dynamic load balancing module calculates the dynamic weight of the web service cluster in real time by adopting weighted summation according to the specific type of the working load and the performance monitoring data of the web cluster, so as to realize reasonable forwarding and efficient processing of the flow;
the dynamic load balancing is realized by using Consul to realize the functions of registering and discovering the dynamic load balancing, the Upsync is used to realize that the Nginx server dynamically acquires the latest upstream list, and the Nginx reads the configuration information in real time after modifying the Nginx configuration information each time, so that the redundant step of restarting the Nginx configuration information after modifying the Nginx configuration information is eliminated;
the Web server cluster is realized by adopting a mode of matching Nginx + Tomcat, Nginx processes multi-user concurrent requests based on an event-driven model, has incomparable advantages in the aspect of processing static resources, and has expansibility and stability, so that Nginx is used as a Web server to process the static resources; in the aspect of processing dynamic resources, Tomcat has good performance in the aspects of expandability and safety, so Tomcat is used as a Web server to process dynamic resources, and different ports are configured to realize a Web server cluster;
the database server comprises a hard disk database Mysql and a Memcached memory database for realizing session sharing; the session sharing is to maintain consistency of session data among a plurality of nodes of the cluster, and the session sharing based on the memcached cache is adopted here.
2. The high availability based web high concurrency system of claim 1, wherein: in the dynamic load balancing module, when the performance indexes of the servers are periodically calculated, the real-time utilization rate of each server is added, the four performance indexes are subjected to normalization processing to obtain the real-time performance indexes of the servers, and the types of work requests are divided into three types: and the cpu intensive type, the IO intensive type and the response time type are used for obtaining corresponding index weights, and finally obtaining the real-time dynamic weight of the server, wherein the larger the value is, the larger the distributed probability is.
3. The high availability based web high concurrency system framework according to claim 1 or 2, wherein: the real-time dynamic weight is obtained by summing four performance indexes of the server and index weights, and the four performance indexes are real-time performance data obtained by monitoring and reflect the real-time load capacity of the server; the index weight is the optimal distribution number obtained according to the type of the work request, and the process is as follows:
(1)cpuirepresenting the CPU availability performance of the web server, CPU _ limit representing the maximum available core number of the web server, CPU _ freq representing CPU main frequency, and CPU _ utilization representing CPU real-time utilization, wherein the formula is defined as follows:
Figure FDA0002364154810000021
(2)memithe method comprises the following steps of representing the available performance of a web server memory, representing the maximum available memory of the web server by mem _ limit, representing the memory frequency by mem _ freq, representing the real-time utilization rate of the memory by mem _ utilization, and defining a formula as follows:
Figure FDA0002364154810000031
(3)fsirepresenting the availability of the web server hard disk, fs _ read _ speed representing the reading speed of the hard disk, and fs _ write _ speed representing the writing speed of the hard diskFs _ utilizations represents the real-time utilization of the hard disk, and the formula is defined as follows:
Figure FDA0002364154810000032
(4)netithe method comprises the steps of representing the network transceiving speed of a web server, representing the network communication state of a current server, representing the receiving speed of the network flow of the server by net _ receive _ speed, and representing the sending speed of the network flow of the server by net _ transmit _ speed;
neti=net_receive_speed+net_tranmit_speed
assuming that the number of web server clusters is N, the ith web server performance indicator parameter may be defined as follows:
Pi=[cpui,memi,fsi,neti]
when each period starts, calculating a load value, and P is the threshold value when only one of the four hardware occupancy rates reaches the threshold valueiIf the three occupancy rates of a certain server are all 0, the server is down, Pi0, the request cannot reach the server until normal is recovered;
in order to eliminate the influence of different dimensions on the weighted summation, a normalization method is adopted to process cpu, memory, hard disk and network index data, and the normalization data is as follows:
Pi'=[cpui',memi',fsi',neti']
cpui' represents a normalized web server cpu real-time performance index, the larger the value of which represents the better the current server cpu performance;
Figure FDA0002364154810000041
memithe real-time performance index of the memory of the normalized web server is represented, and the larger the value of the real-time performance index is, the better the performance of the memory of the current server is represented;
Figure FDA0002364154810000042
fsithe real-time performance index of the web server hard disk is normalized, and the larger the value of the index is, the better the performance of the current server hard disk is;
Figure FDA0002364154810000043
neti' represents a normalized web server network real-time performance index, and the larger the value of the index is, the better the current server network communication performance is;
Figure FDA0002364154810000044
setting the weight of the corresponding index according to the corresponding performance monitoring data:
K=[Kc,Km,Kf,Kn]wherein Kc+Km+Kf+Kn=1
The weight of the corresponding performance index can be set according to the characteristics of the working load, so that the load weight of the web server cluster is dynamically adjusted, the flow is reasonably forwarded to the optimal web server, the concurrent processing performance of the system is improved, and the working load of the web system can be divided into the following three types according to the difference of specific special service scenes:
(1) cpu intensive: a large amount of CPU resources are consumed by calculation, for example, high-definition decoding is performed on resources such as videos, and data analysis and calculation operations of social network sites are required, so that the specific gravity of the CPU and the memory should be increased appropriately, and a large amount of requests can be transmitted to a server with sufficient CPU and memory for operation;
(2) IO intensive: a large amount of IO operations, such as network data transmission, are required to be performed, database operations are frequently operated, and at this time, the proportion of networks and IO should be properly increased, so that a large amount of requests can be transmitted to a server with sufficient IO resources;
(3) response time type: most of online websites pay attention to user experience, and require that the response speed of the system is high, and at the moment, all factors can be considered, and the request is forwarded to a server with good average performance of the system as much as possible to be executed, so that the response time performance of the system is ensured;
real-time dynamic weights W with weight summation web serveriThe calculation is as follows:
Wi=Pi'×KT
the overall dynamic weight W of the web server cluster is:
W=P×KT=[P′1,P′2,...,P′N]×KT
4. the high availability based web high concurrency system framework according to claim 1 or 2, wherein: the dynamic load balancing realizes the functions of registering and discovering the dynamic load balancing by using Consul, realizes that the Nginx server dynamically acquires the latest upstream list by using Upsync, and reads the configuration information in real time after the Nginx configuration information is modified each time, thereby avoiding the redundant step of restarting the Nginx configuration information after the Nginx configuration information is modified.
5. The high availability based web high concurrency system framework according to claim 1 or 2, wherein: in the high availability scheme, when the main load balancer master is in a normal working state, the backup load balancer backup is in a dormant state temporarily, and simultaneously, the health state of the main load balancer master is monitored continuously, once the main load balancer master is found to be abnormal, namely the backup load balancer master cannot receive a VRRP packet, the master is considered to be down, all resources of the main load balancer need to be taken over immediately at the moment, one backup load balancer can be selected according to the priority of VRRP, and the configuration of the backup load balancer is generally consistent with that of the main load balancer in order to effectively take over service.
6. The high availability based web high concurrency system framework according to claim 1 or 2, wherein: in the session sharing, the cacheDB is used for storing the session information, the back-end server receives a new request and stores the session information in the cacheDB, when the back-end server fails, the scheduler can search for available nodes and distribute the request in a traversing manner, when the application server finds that the session is not in the memory of the local machine, the application server searches in the cacheDB, and if the session is found, the session is copied to the local machine, so that the session sharing and high availability are realized.
7. A high availability web high concurrency system implemented method according to claim 1, characterized in that said method comprises the steps of:
s1, when the load balancer receives the client request, the resource types of the user request are classified, the static resource is processed by the static resource server, the load balancer carries out forward proxy, the URL _ HASH algorithm is adopted, meanwhile, the static resource server is added with cache, so that the response speed of the back-end server is greatly improved;
s2, when the request is a dynamic resource, the load balancer carries out reverse proxy, dynamically adjusts the upstream list of the Nginx server through a dynamic load balancing algorithm, and hands the user request to the dynamic resource server for processing;
s3, the load balancer cluster adopts Keepalive to ensure that one main load balancer is always in a normal working state;
s4, the dynamic resource server cluster obtains database data through interaction with the hard disk database Mysql, and session data are shared through the memory database Memcached.
CN202010030614.XA 2020-01-13 2020-01-13 High-availability-based web high-concurrency system and method Pending CN111277629A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010030614.XA CN111277629A (en) 2020-01-13 2020-01-13 High-availability-based web high-concurrency system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010030614.XA CN111277629A (en) 2020-01-13 2020-01-13 High-availability-based web high-concurrency system and method

Publications (1)

Publication Number Publication Date
CN111277629A true CN111277629A (en) 2020-06-12

Family

ID=70998843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010030614.XA Pending CN111277629A (en) 2020-01-13 2020-01-13 High-availability-based web high-concurrency system and method

Country Status (1)

Country Link
CN (1) CN111277629A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770181A (en) * 2020-06-29 2020-10-13 重庆紫光华山智安科技有限公司 Access method, device and equipment of Internet of things equipment
CN112073491A (en) * 2020-08-31 2020-12-11 北京中交创新投资发展有限公司 Gateway agent and service scheduling method for Internet GIS application
CN112596911A (en) * 2020-12-29 2021-04-02 恩亿科(北京)数据科技有限公司 Automatic operation and maintenance method and system for high-availability distributed system
CN112988389A (en) * 2021-03-22 2021-06-18 成都卓拙科技有限公司 Automatic scaling method and system combining load regulation and periodic regulation
CN113572828A (en) * 2021-07-13 2021-10-29 壹药网科技(上海)股份有限公司 System for improving client load balance based on URL grouping granularity
CN113630434A (en) * 2021-06-19 2021-11-09 特瓦特能源科技有限公司 Processing method for client access request and server
CN113742086A (en) * 2021-09-17 2021-12-03 中环曼普科技(南京)有限公司 Distributed parallel analysis type data cluster management method and system
CN113938488A (en) * 2021-09-24 2022-01-14 浙江理工大学 Load balancing method based on dynamic and static weighted polling
CN114238037A (en) * 2022-02-28 2022-03-25 北京金堤科技有限公司 High-concurrency service request result storage method and device, electronic equipment and storage medium
WO2022222579A1 (en) * 2021-04-23 2022-10-27 焦点科技股份有限公司 Database middleware cluster-based high-availability client load balancing method
CN116700956A (en) * 2023-05-23 2023-09-05 海易科技(北京)有限公司 Request processing method, apparatus, electronic device and computer readable medium
CN116760835A (en) * 2023-08-15 2023-09-15 深圳华锐分布式技术股份有限公司 Distributed storage method, device and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2523423A1 (en) * 2011-05-10 2012-11-14 Deutsche Telekom AG Method and system for providing a distributed scalable hosting environment for web services
CN106993037A (en) * 2017-03-31 2017-07-28 山东超越数控电子有限公司 A kind of method that load-balanced server based on distributed system realizes high availability
CN108111586A (en) * 2017-12-14 2018-06-01 重庆邮电大学 The web cluster system and method that a kind of high concurrent is supported
CN108200124A (en) * 2017-12-12 2018-06-22 武汉烽火众智数字技术有限责任公司 A kind of High Availabitity application architecture and construction method
CN110012098A (en) * 2019-04-04 2019-07-12 浙江工业大学 A kind of web high concurrent access process system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2523423A1 (en) * 2011-05-10 2012-11-14 Deutsche Telekom AG Method and system for providing a distributed scalable hosting environment for web services
CN106993037A (en) * 2017-03-31 2017-07-28 山东超越数控电子有限公司 A kind of method that load-balanced server based on distributed system realizes high availability
CN108200124A (en) * 2017-12-12 2018-06-22 武汉烽火众智数字技术有限责任公司 A kind of High Availabitity application architecture and construction method
CN108111586A (en) * 2017-12-14 2018-06-01 重庆邮电大学 The web cluster system and method that a kind of high concurrent is supported
CN110012098A (en) * 2019-04-04 2019-07-12 浙江工业大学 A kind of web high concurrent access process system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘卓: "基于Nginx的负载均衡集群设计与实现", 《桂林电子科技大学学报》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770181A (en) * 2020-06-29 2020-10-13 重庆紫光华山智安科技有限公司 Access method, device and equipment of Internet of things equipment
CN112073491A (en) * 2020-08-31 2020-12-11 北京中交创新投资发展有限公司 Gateway agent and service scheduling method for Internet GIS application
CN112073491B (en) * 2020-08-31 2023-08-22 交信北斗科技有限公司 Gateway proxy and service scheduling method for Internet GIS application
CN112596911A (en) * 2020-12-29 2021-04-02 恩亿科(北京)数据科技有限公司 Automatic operation and maintenance method and system for high-availability distributed system
CN112988389A (en) * 2021-03-22 2021-06-18 成都卓拙科技有限公司 Automatic scaling method and system combining load regulation and periodic regulation
CN112988389B (en) * 2021-03-22 2023-08-11 成都卓拙科技有限公司 Automatic telescoping method and system combining load regulation and periodicity regulation
WO2022222579A1 (en) * 2021-04-23 2022-10-27 焦点科技股份有限公司 Database middleware cluster-based high-availability client load balancing method
CN113630434A (en) * 2021-06-19 2021-11-09 特瓦特能源科技有限公司 Processing method for client access request and server
CN113572828A (en) * 2021-07-13 2021-10-29 壹药网科技(上海)股份有限公司 System for improving client load balance based on URL grouping granularity
CN113572828B (en) * 2021-07-13 2024-04-09 壹药网科技(上海)股份有限公司 System for improving client load balance based on URL grouping granularity
CN113742086A (en) * 2021-09-17 2021-12-03 中环曼普科技(南京)有限公司 Distributed parallel analysis type data cluster management method and system
CN113938488A (en) * 2021-09-24 2022-01-14 浙江理工大学 Load balancing method based on dynamic and static weighted polling
CN113938488B (en) * 2021-09-24 2023-11-24 浙江理工大学 Load balancing method based on dynamic and static weighted polling
CN114238037B (en) * 2022-02-28 2022-04-29 北京金堤科技有限公司 High-concurrency service request result storage method and device, electronic equipment and storage medium
CN114238037A (en) * 2022-02-28 2022-03-25 北京金堤科技有限公司 High-concurrency service request result storage method and device, electronic equipment and storage medium
CN116700956A (en) * 2023-05-23 2023-09-05 海易科技(北京)有限公司 Request processing method, apparatus, electronic device and computer readable medium
CN116700956B (en) * 2023-05-23 2024-02-23 海易科技(北京)有限公司 Request processing method, apparatus, electronic device and computer readable medium
CN116760835A (en) * 2023-08-15 2023-09-15 深圳华锐分布式技术股份有限公司 Distributed storage method, device and medium
CN116760835B (en) * 2023-08-15 2023-10-20 深圳华锐分布式技术股份有限公司 Distributed storage method, device and medium

Similar Documents

Publication Publication Date Title
CN111277629A (en) High-availability-based web high-concurrency system and method
Rostanski et al. Evaluation of highly available and fault-tolerant middleware clustered architectures using RabbitMQ
US6330605B1 (en) Proxy cache cluster
EP2901308B1 (en) Load distribution in data networks
US20170070457A1 (en) Multiplexed demand signaled distributed messaging
CN102164116B (en) Method, system and corresponding device for balancing load
CN103475566A (en) Real-time message exchange platform and distributed cluster establishment method
WO2021120633A1 (en) Load balancing method and related device
CN112492022A (en) Cluster, method, system and storage medium for improving database availability
Aditya et al. A high availability (HA) MariaDB Galera Cluster across data center with optimized WRR scheduling algorithm of LVS-TUN
CN112583895B (en) TCP communication method, system and device
JP2013543169A (en) System including middleware machine environment
Jin et al. Content routing and lookup schemes using global bloom filter for content-delivery-as-a-service
CN114900524A (en) Load balancing and node delay reducing method for MQTT service
Gupta et al. Reliability aware load balancing algorithm for content delivery network
CN103795766B (en) A kind of P2SP multi-source download system
CN112711465A (en) Data processing method and device based on cloud platform, electronic equipment and storage medium
CN111541667A (en) Method, equipment and storage medium for intersystem message communication
Rotaru et al. Reliable messaging to millions of users with migratorydata
Yang et al. DZMQ: A decentralized distributed messaging system for realtime Web applications and services
Zerfiridis et al. File distribution using a peer-to-peer network––a simulation study
Shih et al. Service recovery for large scale distributed publish and subscription services for cyber-physical systems and disaster management
Hao et al. A Stochastic Adjustment Strategy for Coordination Process in Distributed Networks
Fan et al. The raincore distributed session service for networking elements
CN117640644A (en) Processing method, system and related device for load balancing of sea-related data transaction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200612