CN110401708B - Session processing system and method based on server load state - Google Patents

Session processing system and method based on server load state Download PDF

Info

Publication number
CN110401708B
CN110401708B CN201910670425.6A CN201910670425A CN110401708B CN 110401708 B CN110401708 B CN 110401708B CN 201910670425 A CN201910670425 A CN 201910670425A CN 110401708 B CN110401708 B CN 110401708B
Authority
CN
China
Prior art keywords
server
address list
preset
load
client
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.)
Active
Application number
CN201910670425.6A
Other languages
Chinese (zh)
Other versions
CN110401708A (en
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.)
South Central Minzu University
Original Assignee
South Central University for Nationalities
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 South Central University for Nationalities filed Critical South Central University for Nationalities
Priority to CN201910670425.6A priority Critical patent/CN110401708B/en
Publication of CN110401708A publication Critical patent/CN110401708A/en
Application granted granted Critical
Publication of CN110401708B publication Critical patent/CN110401708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a session processing system and a method based on server load state, comprising the following steps: the method comprises the steps that a client side obtains a corresponding server to be connected when receiving a session connection request; calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from the server registration center and judging whether the server to be connected meets preset connection conditions or not according to the information; when the cluster server address is not satisfied, selecting a target server address from the cluster server address list through a preset address list manager; and then establishing session connection with the target server corresponding to the target server address. Because the servers to be connected are screened according to the comprehensive load information corresponding to the servers, the target servers are reselected from the local cluster servers to establish session connection when the screened servers do not meet the connection condition, the screened target servers can be ensured to stably provide session service for the client, and the occurrence of session interruption caused by the downtime of the servers due to high load is avoided.

Description

Session processing system and method based on server load state
Technical Field
The invention relates to the technical field of computers, in particular to a session processing system and method based on a server load state.
Background
In a ZooKeeper (a distributed application program coordination service with distributed and open source codes), if a client is connected to a ZooKeeper server, only the factor of the fastest response time is considered, which may cause that a certain ZooKeeper server has too heavy resources, and in a serious case, a server may be down to stop the service. The downtime is very huge for enterprises with a large number of users, so that the user experience is influenced if the cost is low, and irreparable loss is directly caused to companies if the cost is high. Therefore, how to ensure that the server connected with the client can operate stably and avoid session interruption caused by the downtime of the server becomes a problem to be solved urgently.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a session processing system and method based on a server load state, and aims to solve the technical problems that the prior art cannot effectively ensure that a server connected with a client can stably run, and session interruption caused by server downtime is avoided.
To achieve the above object, the present invention provides a session processing system based on server load status, the system comprising:
the client is used for acquiring a server to be connected corresponding to the session connection request when receiving the session connection request;
the client is also used for calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from a server registration center and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information;
the client is also used for selecting a target server address from a local pre-stored cluster server address list through a preset address list manager when the server to be connected does not meet the preset connection condition;
and the client is also used for determining a corresponding target server according to the target server address and establishing session connection with the target server.
Preferably, the integrated load information includes: system load, central processing unit utilization rate, memory occupancy rate and disk utilization rate;
and the client is also used for judging whether the server to be connected meets preset connection conditions according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the disk utilization rate.
Preferably, the client is further configured to calculate, according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate, a comprehensive load value corresponding to the server to be connected through a preset formula;
the client is further used for determining a current load state corresponding to the server to be connected according to the comprehensive load value and judging whether the server to be connected meets a preset connection condition or not according to the current load state;
wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
wherein CHSLoad is the combined load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
Preferably, the client is further configured to call the preset thread to connect to the server registration center, monitor the registered server in the server registration center to obtain the comprehensive load information corresponding to the registered server, and read the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information.
Preferably, the client is further configured to obtain, by the preset address list manager, a current server address list corresponding to the distributed cluster from the server registry;
the client is further used for detecting whether the current server address list is consistent with the cluster server address list, and if not, network delay information of a server corresponding to each server address in the current server address list is obtained;
the client is further configured to sequentially adjust the server addresses included in the current server address list according to the network delay information to obtain a server address list to be cached;
and the client is also used for caching the address list of the server to be cached as a new cluster server address list.
The preset address list manager is used for acquiring the address list length corresponding to a local pre-stored cluster server address list, detecting whether the address list length is smaller than the preset length, and if so, selecting an available server address carrying a preset mark from the local pre-stored cluster server address list;
preferably, the preset address list manager is further configured to verify whether a server corresponding to the available server address is in a high load state, and if not, select a target server address from the available server addresses.
In addition, to achieve the above object, the present invention further provides a session processing method based on a server load status, where the method includes:
when a session connection request is received, acquiring a server to be connected corresponding to the session connection request;
calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from a server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information;
when the server to be connected does not meet the preset connection condition, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager;
and determining a corresponding target server according to the target server address, and establishing session connection with the target server.
Preferably, the integrated load information includes: system load, central processing unit utilization rate, memory occupancy rate and disk utilization rate;
the step of judging whether the server to be connected meets the preset connection condition according to the comprehensive load information comprises the following steps:
and judging whether the server to be connected meets a preset connection condition or not according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the disk utilization rate.
Preferably, the step of determining whether the server to be connected satisfies a preset connection condition according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate includes:
calculating a comprehensive load value corresponding to the server to be connected through a preset formula according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the utilization rate of the disk;
determining a current load state corresponding to the server to be connected according to the comprehensive load value, and judging whether the server to be connected meets a preset connection condition or not according to the current load state;
wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
wherein CHSLoad is the combined load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
Preferably, the step of calling the preset thread to obtain the comprehensive load information corresponding to the server to be connected from a server registration center, and determining whether the server to be connected meets the preset connection condition according to the comprehensive load information includes:
calling the preset thread to connect the server registration center, and monitoring the registered server in the server registration center to acquire comprehensive load information corresponding to the registered server;
and reading the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information, and judging whether the server to be connected meets a preset connection condition according to the read comprehensive load information.
When a client receives a session connection request, a server to be connected corresponding to the session connection request is obtained; calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from the server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information; if not, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager; and then determining a corresponding target server according to the address of the target server, and establishing session connection with the target server. According to the method and the system, the servers to be connected are screened according to the comprehensive load information corresponding to the servers, and the target server is reselected from the local cluster server to establish session connection when the screened servers do not meet the connection condition, so that the screened target server can be ensured to stably provide session service for the client, and the occurrence of session interruption caused by the downtime of the server due to high load is avoided to a greater extent.
Drawings
FIG. 1 is a schematic diagram of a session processing system based on server load status according to the present invention;
FIG. 2 is a flowchart illustrating a session processing method based on server load status according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a session processing method based on server load status according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a session processing method based on a server load status according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a session processing system based on a server load status according to the present invention.
As shown in fig. 1, the session processing system based on the server load status may include: a client 1001, a preset address list manager 1002, and a server registry 1003. In this embodiment, the preset address list manager 1002 may obtain load information of each server in the ZooKeeper cluster and a network delay condition of each server from a cache. The server registration center 1003 may be implemented by using a ZooKeeper server, and mainly provides information storage for all service registrations, for the ZooKeeper client to call.
Those skilled in the art will appreciate that the architecture shown in fig. 1 does not constitute a limitation of the present embodiment of a server load state-based session processing system, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
In this embodiment, the session processing system based on the server load status includes:
a client 1001, configured to obtain a to-be-connected server corresponding to a session connection request when receiving the session connection request;
it should be noted that the session connection request may be an instruction sent by the ZooKeeper client as the service requester to establish a session link with the target server. In this embodiment, the client 1001 needs to acquire the comprehensive load information of the servers to be connected from the server registry 1003, and then decide which server should be connected according to the comprehensive load information.
In a specific implementation, when receiving a session connection request triggered by a user, the client 1001 determines a server to be accessed according to request resource information included in a request header of the session connection request. It should be understood that, in a distributed cluster scenario, the request resource information is usually stored in a plurality of servers, that is, the number of the servers to be connected in this embodiment may be one or more.
The client 1001 is further configured to invoke a preset thread to obtain comprehensive load information corresponding to the server to be connected from the server registration center 1003, and determine whether the server to be connected meets a preset connection condition according to the comprehensive load information;
it should be understood that the server registry 1003 is used in the present embodiment to provide a storage and management service of registration information for the ZooKeeper server. When each ZooKeeper server registers in the server registration center 1003, a directory "/loadInfo" may be established in the ZooKeeper registration center, then when the ZooKeeper server is started, a pre-configured script program for acquiring hardware resource information of the ZooKeeper server is also started, and a temporary node directory is created under the "/loadInfo" directory, where the name of the node directory may be an Internet Protocol Address (IP Address) and a port number of the ZooKeeper server where the script program is located; and then saving the ZooKeeper server hardware resource information (including system load, central processing unit utilization rate, memory occupancy rate, disk utilization rate and the like) acquired by the script program to a local storage space. The load comprehensive information can be obtained by the ZooKeeper server through calculation according to the hardware resource information.
It should be noted that the preset thread may be a preset ZKLoadThread, and the thread is used to connect to the server registration center 1003, acquire child node information registered under the loadInfo, and monitor the loadInfo node, and once the loadInfo node changes, the ZKLoadThread may acquire the latest load information of the ZooKeeper server in time. Specifically, the client 1001 may call the preset ZKLoadThread to connect to the server registration center 1003, monitor a server registered in the server registration center 1003 to obtain the comprehensive load information corresponding to the registered server, and then read the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information.
In this embodiment, the manner of determining whether the server to be connected satisfies the preset connection condition may be to detect whether a parameter value corresponding to one of the pieces of information in the combined load information exceeds or does not exceed a preset value, or to detect whether a weighted average value corresponding to two or more pieces of information in the combined load information exceeds or does not exceed a preset value.
In a specific implementation, the client 1001 may call a preset ZKLoadThread to obtain, from the server registration center 1003, comprehensive load information corresponding to the server to be connected, and then determine whether the server to be connected satisfies the preset connection condition according to the comprehensive load information.
Further, considering that there are many load information affecting the operation rate of the server, in order to improve the session connection efficiency, the comprehensive load information in this embodiment mainly includes a system load, a central processing unit utilization rate, a memory occupancy rate, and a disk utilization rate. Correspondingly, in this embodiment, the client 1001 is further configured to determine whether the server to be connected meets a preset connection condition according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate.
The system load is defined as the average number of processes in the running queue in a specific time interval, and the system load comprises information which is not the utilization rate condition of the CPU but the statistical information of the sum of the number of processes which are processed by the CPU and wait for the CPU to process in a period of time, namely the statistical information of the length of the CPU utilization queue, and can be obtained by the proc/loadavg file. For example, the system load may be collected over 5 minutes and then the system load θ for a single server may be calculatedloadNumber of cores of server NumcpuCan be obtained by the command grep 'model name'/proc/cpuininfo | wc-l.
The calculation formula of the server system load in this embodiment is as follows:
Numcpu=grep'model name'/proc/cpuinfo|wc-l
Figure BDA0002140266220000071
where Lavg _ n, n ═ 5 is the average system load over 5 minutes.
Furthermore, the utilization rate of the central processing unit, namely the CPU utilization rate, can be obtained through a proc/stat file, and real-time CPU state information is stored in the proc/stat file. The CPU utilization rate is the ratio of the time slices in the busy stage to the total CPU time slices, which represents the running condition of the machine at a certain time point, and the higher the CPU utilization rate is, the server is busy, otherwise, the server is idle.
In this embodiment, the state data of the CPU is counted every 5 seconds, and the Total time slice Total2 and the free time slice Total1 of the CPU and the CPU utilization rate θ are calculated by the following formulacpuIn the following formula, the parameter code corresponding to the total time slice is "2" and the parameter code corresponding to the idle time slice is "1")
Total1=user1+nice1+system1+idle1+iowait1+irq1+softirq1+steal1+guest1
Total2=user2+nice2+system2+idle2+iowait2+irq2+softirq2+steal2+guest2
Figure BDA0002140266220000072
In the formula, USER is the time of the CPU in the USER mode, nice is the process execution time of the CPU in the USER mode at low priority, System is the time of the CPU in the core mode, Idle is the time of the System in the Idle process, the value is the value of the second field in the USER _ HZ multiplied by/proc/update file, Iowait is the time of the CPU in I/O waiting, Irq is the time overhead of the CPU in interrupting a service program, Softirq is the time of the CPU processing software interruption, Steal is the CPU time occupied by other operating systems in a virtual environment, and Guest is the time of the CPU virtually under the control of a kernel to access a client operating System.
In this embodiment, the memory occupancy rate θ ismemThe method can be obtained by reading a proc/meminfo file, and the main indexes involved in calculating the memory occupancy rate include: MenTotal, MemFree, Buffers and Cached, and the calculation formula of the memory occupancy rate is as follows:
Figure BDA0002140266220000081
in the formula, MemTotal represents the size of all available ram of the system, MemFree represents the unused memory of the system, Buffers represents the size used for buffering files, and Cached represents the size of the memory used by the cache.
Further, the disk utilization θ in this embodimenti/oThe utilization rate of the disk I/O is also called, and the utilization rate can be obtained through an iostat command under a terminal of a Linux system. Typically, the percentage of disk active time is expressed by% util, i.e., disk I/O utilization disk utilization is proportional to the degree of resource contention and inversely proportional to performance. If the disk utilization exceeds 70%, it takes longer for the read and write operations to complete, and when this occurs, most processes will be blocked or hibernated while waiting. The calculation formula of the disk I/O utilization rate in the embodiment is as follows: thetai/o=%util。
In a specific implementation, the client 1001 may determine whether the to-be-connected server meets a preset connection condition according to the obtained system load, the cpu utilization rate, the memory occupancy rate, and the disk utilization rate, and if the preset connection condition is met, directly use the to-be-connected server as a target server and establish a session connection with the target server, or select one server from the to-be-connected servers as the target server to establish the session connection.
The client 1001 is further configured to select a target server address from a locally pre-stored cluster server address list through a preset address list manager 1002 when the server to be connected does not satisfy the preset connection condition;
it should be noted that, in this embodiment, the preset address list manager 1002 may call a serveraddressethread to periodically obtain a ZooKeeper server address from the server registration center 1003, then compare the obtained server address with a server address in a locally pre-stored cluster server address list, if it is found that address list update is needed, sort the obtained server addresses according to network delay, and update the server addresses to the cluster server address list, so as to obtain a latest cluster server address list.
In a specific implementation, if the client 1001 detects that the server to be connected does not satisfy the preset connection condition, the preset address list manager 1002 may select a target server address from a local pre-stored cluster server address list. The selection manner of the target server address in this embodiment may be random selection, or may be selection by setting a screening policy (for example, selecting a server with the minimum network delay) according to an actual situation, which is not limited in this embodiment.
The client 1001 is further configured to determine a corresponding target server according to the target server address, and establish a session connection with the target server.
In a specific implementation, after the address of the target server is screened out, the client 1001 may determine the corresponding target server according to the address of the target server, and then establish a session connection with the target server, and the target server performs subsequent request response.
When receiving a session connection request, a client acquires a to-be-connected server corresponding to the session connection request; calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from the server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information; if not, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager; and then determining a corresponding target server according to the address of the target server, and establishing session connection with the target server. In the embodiment, the servers to be connected are screened according to the comprehensive load information corresponding to the servers, and when the screened servers do not meet the connection condition, the target servers are reselected from the local cluster servers to establish session connection, so that the screened target servers can be ensured to stably provide session service for the client, and the occurrence of session interruption caused by the downtime of the servers due to high load is avoided to a greater extent.
Based on the first embodiment of the session processing system based on the server load status, the second embodiment of the session processing system based on the server load status is proposed.
In this embodiment, the client 1001 is further configured to calculate, according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate, a comprehensive load value corresponding to the server to be connected through a preset formula; wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
in the above formula, CHSLoad is the integrated load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
In a specific implementation, the client 1001 may calculate, according to the obtained system load, the cpu utilization, the memory occupancy, and the disk utilization, a comprehensive load value corresponding to the server to be connected according to the preset formula.
The client 1001 is further configured to determine a current load state corresponding to the server to be connected according to the comprehensive load value, and determine whether the server to be connected meets a preset connection condition according to the current load state;
it should be noted that the current load state in this embodiment includes a low load, a normal load, and a high load. In this embodiment, the comprehensive load value CHSLoad and the system load θ corresponding to each load stateloadCentral processor utilization factor thetacpuMemory occupancy rate θmemAnd disk utilization factor thetai/oSpecifically, table 1 below shows the load state index evaluation table in table 1.
Table 1 load state index evaluation table
Figure BDA0002140266220000101
As can be seen from table 1 above, when the integrated load value of the server to be connected belongs to the range of [0, 2.40), the state is in the low load state, when the integrated load value of the server to be connected belongs to the range of [2.40, 3.45), the state is in the normal load state, and when the integrated load value of the server to be connected belongs to the range of [3.45, + ∞) the state is in the high load state.
The client side calculates a comprehensive load value corresponding to the server to be connected according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the utilization rate of the disk through a preset formula; and then determining the current load state corresponding to the server to be connected according to the comprehensive load value, and then judging whether the server to be connected meets the preset connection condition or not according to the current load state, so that whether servers with good load conditions except the server to be connected need to be selected to establish session connection or not can be determined, the selected target server can be ensured to run stably to the maximum extent, and the condition that the session is interrupted due to the downtime of the server can be avoided.
A third embodiment of the server load status based session processing system of the present invention is proposed based on the above-mentioned first embodiment of the server load status based session processing system.
In this embodiment, the client 1001 is further configured to obtain, from the server registry 1003, a current server address list corresponding to the distributed cluster through the preset address list manager;
it should be noted that, in this embodiment, the distributed cluster is a distributed server cluster in which a server registered in the server center 1003 is located. The current server address list is the server address list that is updated in the server center 1003 last time.
In a specific implementation, the client 1001 obtains a current server address list corresponding to the distributed cluster from the server registry 1003 through the preset address list manager.
The client 1001 is further configured to detect whether the current server address list is consistent with the cluster server address list, and if not, obtain network delay information of a server corresponding to each server address in the current server address list;
it should be noted that the network delay information generally refers to the round-trip time of sending a data packet from the user's computer to the web server and then immediately returning the data packet from the web server to the user's computer. In popular terms, it is the time taken for data to pass from the computer to the computer. The network latency described in this embodiment refers to the network latency between the client 1001 and the Zookeeper server. The client can send the same ping command to all servers in the current server address list and then record the sending time t of the ping command1And a receiving time t of receiving the ping command feedback result4Then, each server record is obtained and fed back to the receiving time t of the ping command received by the client2And a return time t when a feedback result is returned to the client when the ping command response is finished3Finally, the client end sets the network delay as (t) according to the formula2-t1)+(t4-t3) And then the current network delay of each server can be calculated.
It should be understood that, in this embodiment, if the client 1001 detects that the current server address list is consistent with the cluster server address list, it indicates that the cluster server address list locally stored by the client 1001 does not need to be updated, otherwise, the update is needed.
In a specific implementation, if the client 1001 detects that the current server address list is inconsistent with the cluster server address list, network delay information of a server corresponding to each server address in the current server address list is obtained.
The client 1001 is further configured to sequentially adjust the server addresses included in the current server address list according to the network delay information, so as to obtain a server address list to be cached;
it should be noted that, in this embodiment, the manner of sequentially adjusting the servers may be to perform size sorting on the network delays included in the network delay information in a sequence from small to large, and then sequentially adjust the server addresses included in the current server address list according to a sorting result, so as to obtain the server address list to be cached.
The client 1001 is further configured to cache the server address list to be cached as a new cluster server address list.
In a specific implementation, after obtaining the address list of the server to be cached, the client 1001 may cache the address list as a new cluster server address list.
The client side of the embodiment acquires a current server address list corresponding to the distributed cluster from the server registration center through a preset address list manager; detecting whether the current server address list is consistent with the cluster server address list or not, and if not, acquiring network delay information of a server corresponding to each server address in the current server address list; sequentially adjusting the server addresses contained in the current server address list according to the network delay information to obtain a server address list to be cached; the server address list to be cached is taken as a new cluster server address list for caching, so that the server address stored in the cluster server address list locally stored by the client can be ensured to be the latest server address, and the client can conveniently select the server address corresponding to the server with smaller network delay from the server address list.
Based on the first embodiment of the session processing system based on the server load status, a fourth embodiment of the session processing system based on the server load status is proposed.
In this embodiment, the preset address list manager 1002 is configured to obtain an address list length corresponding to a locally pre-stored cluster server address list, detect whether the address list length is smaller than a preset length, and select an available server address carrying a preset flag from the locally pre-stored cluster server address list if the address list length is smaller than the preset length;
it should be noted that in the ZooKeeper client session, the statehomeprodivider is adopted as the default to implement the homeprodivider interface, and the preset address list manager 1002 in this embodiment implements the homeprodivier interface through the dynami homeprodivider. The preset address list manager 1002 of this embodiment stores a pre-programmed hardware resource monitoring script program: DynamicHostProvider class. In the DynamicHostProvider class, the next (long) method is a core method of the class and is also a core control module for load balancing of the client. And the subscript corresponding to the preset mark, namely the server address, is index.
In a specific implementation, when calling a next (long) method for the first time, the preset address list manager 1002 first obtains an address list length (index) corresponding to a locally pre-stored cluster server address list, initializes the index to 0, then detects whether the address list length is smaller than a preset length (before it is required to verify whether the address list length is empty), and if so, randomly selects a server address within a specified address length range (i.e., the preset length), and then takes a server corresponding to the server address as a target server.
Similarly, if the preset address list manager 1002 detects that the length of the address list is smaller than the preset length, an available server address carrying a preset flag (index) is selected from a local pre-stored cluster server address list.
The preset address list manager 1002 is further configured to verify whether a server corresponding to the available server address is in a high load state, and if not, select a target server address from the available server addresses.
In a specific implementation, the preset address list manager 1002 further verifies whether a server corresponding to the available server address is in a high load state, and selects a target server address from the available server addresses if the server is not in the high load state. For the verification standard of the specific load status of the server, reference may be made to the second embodiment described above, and details thereof are not repeated here.
Considering that the server addresses in the cluster server address list are arranged from small to large according to the network delay, the preset address list manager 1002 in this embodiment may further select a non-high-load server with the smallest network delay from the available server addresses as a target server, thereby ensuring stable establishment of session connection and improving session connection efficiency.
Referring to fig. 2, fig. 2 is a flowchart illustrating a session processing method based on a server load status according to a first embodiment of the present invention.
In this embodiment, the session processing method based on the server load status includes:
step S10: when a session connection request is received, acquiring a server to be connected corresponding to the session connection request;
it should be noted that the execution main body of the method of this embodiment may be a client program having data processing, program running, and network communication functions, which is hereinafter referred to as a client.
It should be understood that the session connection request may be an instruction sent by a client (ZooKeeper) as a service requester to establish a session link with a target server. In this embodiment, the client needs to obtain the comprehensive load information of the server to be connected from the server registry, and then determine which server should be connected according to the comprehensive load information. The server registration center can be realized by adopting a ZooKeeper server, and mainly provides information storage of all service registrations for being called by a (ZooKeeper) client.
In a specific implementation, when a client receives a session connection request triggered by a user, a server to be accessed is determined according to request resource information contained in a request header of the session connection request. It should be understood that, in a distributed cluster scenario, the request resource information is usually stored in a plurality of servers, that is, the number of the servers to be connected in this embodiment may be one or more.
Step S20: calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from a server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information;
it should be understood that the server registry described in this embodiment is used to provide a storage and management service of registration information for the ZooKeeper server. When each ZooKeeper server registers in the server registration center, firstly establishing a directory "/loadInfo" in the ZooKeeper registration center, then when the ZooKeeper server is started, starting a pre-configured script program for acquiring hardware resource information of the ZooKeeper server, and creating a temporary node directory under the "/loadInfo" directory, wherein the name of the node directory can be an Internet Protocol Address (IP Address) and a port number of the ZooKeeper server where the script program is located; and then saving the ZooKeeper server hardware resource information (including system load, central processing unit utilization rate, memory occupancy rate, disk utilization rate and the like) acquired by the script program to a local storage space. The load comprehensive information can be obtained by the ZooKeeper server through calculation according to the hardware resource information.
It should be noted that the preset thread may be a preset ZKLoadThread, and the thread is used to connect to a server registration center, acquire child node information registered under the loadInfo, and monitor the loadInfo node, and once the loadInfo node changes, the ZKLoadThread may acquire the latest load information of the ZooKeeper server in time.
In this embodiment, the manner of determining whether the server to be connected satisfies the preset connection condition may be to detect whether a parameter value corresponding to one of the pieces of information in the combined load information exceeds or does not exceed a preset value, or to detect whether a weighted average value corresponding to two or more pieces of information in the combined load information exceeds or does not exceed a preset value.
In a specific implementation, the client may call a preset ZKLoadThread to obtain comprehensive load information corresponding to the server to be connected from the server registration center, and then determine whether the server to be connected satisfies the preset connection condition according to the comprehensive load information.
Further, considering that there are many load information affecting the operation rate of the server, in order to improve the session connection efficiency, the comprehensive load information in this embodiment mainly includes a system load, a central processing unit utilization rate, a memory occupancy rate, and a disk utilization rate. Correspondingly, the client in this embodiment is further configured to determine whether the server to be connected meets a preset connection condition according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate.
The system load is defined as the average number of processes in the running queue in a specific time interval, and the system load comprises information which is not the utilization rate condition of the CPU but the statistical information of the sum of the number of processes which are processed by the CPU and wait for the CPU to process in a period of time, namely the statistical information of the length of the CPU utilization queue, and can be obtained by the proc/loadavg file. For example, a system load value within 5 minutes may be collected and then a system load θ of a single server may be calculatedloadNumber of cores of server NumcpuCan be obtained by the command grep 'model name'/proc/cpuininfo | wc-l.
The calculation formula of the server system load in this embodiment is as follows:
Numcpu=grep'model name'/proc/cpuinfo|wc-l
Figure BDA0002140266220000151
where Lavg _ n, n ═ 5 is the average system load over 5 minutes.
Furthermore, the utilization rate of the central processing unit, namely the CPU utilization rate, can be obtained through a proc/stat file, and real-time CPU state information is stored in the proc/stat file. The CPU utilization rate is the ratio of the time slices in the busy stage to the total CPU time slices, which represents the running condition of the machine at a certain time point, and the higher the CPU utilization rate is, the server is busy, otherwise, the server is idle.
In this embodiment, the state data of the CPU is counted every 5 seconds, and the Total time slice Total2 and the free time slice Total1 of the CPU and the CPU utilization rate θ are calculated by the following formulacpuIn the following formula, the parameter code corresponding to the total time slice is "2" and the parameter code corresponding to the idle time slice is "1"),
Total1=user1+nice1+system1+idle1+iowait1+irq1+softirq1+steal1+guest1
Total2=user2+nice2+system2+idle2+iowait2+irq2+softirq2+steal2+guest2
Figure BDA0002140266220000152
in the formula, USER is the time of the CPU in the USER mode, nice is the process execution time of the CPU in the USER mode at low priority, System is the time of the CPU in the core mode, Idle is the time of the System in the Idle process, the value is the value of the second field in the USER _ HZ multiplied by/proc/update file, Iowait is the time of the CPU in I/O waiting, Irq is the time overhead of the CPU in interrupting a service program, Softirq is the time of the CPU processing software interruption, Steal is the CPU time occupied by other operating systems in a virtual environment, and Guest is the time of the CPU virtually under the control of a kernel to access a client operating System.
In this embodiment, the memory occupancy rate θ ismemThe method can be obtained by reading a proc/meminfo file, and the main indexes involved in calculating the memory occupancy rate include: MenTotal, MemFree, Buffers and Cached, and the calculation formula of the memory occupancy rate is as follows:
Figure BDA0002140266220000153
in the formula, MemTotal represents the size of all available ram of the system, MemFree represents the unused memory of the system, Buffers represents the size used for buffering files, and Cached represents the size of the memory used by the cache.
Further, the disk utilization θ in this embodimenti/oThe utilization rate of the disk I/O is also called, and the utilization rate can be obtained through an iostat command under a terminal of a Linux system. Typically, the percentage of disk active time is expressed by% util, i.e., disk I/O utilization disk utilization is proportional to the degree of resource contention and inversely proportional to performance. If the disk utilization exceeds 70%, it takes longer for the read and write to complete the I/O operation, when this happensAfter a situation occurs, most processes will be blocked or hibernated while waiting. The calculation formula of the disk I/O utilization rate in the embodiment is as follows: thetai/o=%util。
In a specific implementation, the client may determine whether the to-be-connected server meets a preset connection condition according to the obtained system load, the central processing unit utilization rate, the memory occupancy rate, and the disk utilization rate, and if the preset connection condition is met, directly use the to-be-connected server as a target server and establish session connection with the target server, or select one server from the to-be-connected servers as the target server to establish session connection.
Step S30: when the server to be connected does not meet the preset connection condition, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager;
it should be noted that, in this embodiment, the preset address list manager may call a serveraddressethread to periodically obtain a ZooKeeper server address from a server registration center, then compare the obtained server address with a server address in a locally pre-stored cluster server address list, if it is found that address list update is needed, sort the obtained server address according to network delay, and update the server address into the cluster server address list, so as to obtain a latest cluster server address list.
In a specific implementation, if the client detects that the server to be connected does not meet the preset connection condition, a target server address can be selected from a local pre-stored cluster server address list through the preset address list manager. The selection manner of the target server address in this embodiment may be random selection, or may be selection by setting a screening policy (for example, selecting a server with the minimum network delay) according to an actual situation, which is not limited in this embodiment.
Step S40: and determining a corresponding target server according to the target server address, and establishing session connection with the target server.
In the specific implementation, after the target server address is screened out by the client, the corresponding target server can be determined according to the target server address, then session connection is established with the target server, and the target server carries out subsequent request response.
When receiving a session connection request, a client acquires a to-be-connected server corresponding to the session connection request; calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from the server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information; if not, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager; and then determining a corresponding target server according to the address of the target server, and establishing session connection with the target server. In the embodiment, the servers to be connected are screened according to the comprehensive load information corresponding to the servers, and when the screened servers do not meet the connection condition, the target servers are reselected from the local cluster servers to establish session connection, so that the screened target servers can be ensured to stably provide session service for the client, and the occurrence of session interruption caused by the downtime of the servers due to high load is avoided to a greater extent.
Referring to fig. 3, fig. 3 is a flowchart illustrating a session processing method based on a server load status according to a second embodiment of the present invention.
Based on the first embodiment of the session processing method based on the server load status, in this embodiment, the comprehensive load information includes: system load, central processor utilization, memory occupancy, and disk utilization. Accordingly, the step S20 can be further refined to include:
step S201: calling a preset thread to obtain comprehensive load information corresponding to the server to be connected from a server registration center, wherein the comprehensive load information comprises: system load, central processing unit utilization rate, memory occupancy rate and disk utilization rate;
in a specific implementation, the client may call a preset ZKLoadThread to obtain the comprehensive load information corresponding to the server to be connected from the server registration center.
Step S202: and judging whether the server to be connected meets a preset connection condition or not according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the disk utilization rate.
In a specific implementation, the client may calculate, according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate, a comprehensive load value corresponding to the server to be connected through a preset formula; determining a current load state corresponding to the server to be connected according to the comprehensive load value, and judging whether the server to be connected meets a preset connection condition or not according to the current load state; wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
wherein CHSLoad is the combined load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
It should be noted that the current load state in this embodiment includes a low load, a normal load, and a high load. In this embodiment, the comprehensive load value CHSLoad and the system load θ corresponding to each load stateloadAs can be seen from table 1 in the above-described embodiment of the session processing system based on the server load status, when the integrated load value of the server to be connected belongs to the range of [0, 2.40), the state is in the low load state, when the integrated load value of the server to be connected belongs to the range of [2.40, 3.45), the state is in the normal load state, and when the integrated load value of the server to be connected belongs to the range of [3.45, + ∞) the state is in the high load state.
The client side calculates a comprehensive load value corresponding to the server to be connected according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the utilization rate of the disk through a preset formula; and then determining the current load state corresponding to the server to be connected according to the comprehensive load value, and then judging whether the server to be connected meets the preset connection condition or not according to the current load state, so that whether servers with good load conditions except the server to be connected need to be selected to establish session connection or not can be determined, the selected target server can be ensured to run stably to the maximum extent, and the condition that the session is interrupted due to the downtime of the server can be avoided.
Referring to fig. 4, fig. 4 is a flowchart illustrating a session processing method based on a server load status according to a third embodiment of the present invention.
Based on the foregoing embodiment, a third embodiment of the session processing method based on the server load status according to the present invention is proposed, and in this embodiment, the step S20 may include:
step S201': calling the preset thread to connect the server registration center, and monitoring the registered server in the server registration center to acquire comprehensive load information corresponding to the registered server;
it should be noted that the preset thread may be a preset ZKLoadThread, and the thread is used to connect to the server registration center, acquire the child node information registered under the loadInfo, and monitor the loadInfo node, and once the/loadInfo node changes, the ZKLoadThread may acquire the latest load information of the ZooKeeper server in time, so as to ensure that the comprehensive load information has higher timeliness.
Step S202': and reading the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information, and judging whether the server to be connected meets a preset connection condition according to the read comprehensive load information.
In a specific implementation, after acquiring the comprehensive load information corresponding to each server, the client may read the comprehensive load information corresponding to the server to be connected according to the server identifier corresponding to the server to be connected, and then determine whether the server to be connected meets the preset connection condition according to the read comprehensive load information.
Further, to ensure that the server address stored in the cluster server address list stored in the client is the latest server address, the session processing method based on the server load state in this embodiment further includes the following steps:
step 1: acquiring a current server address list corresponding to the distributed cluster from the server registration center through the preset address list manager;
it should be noted that, in this embodiment, the distributed cluster is a distributed server cluster in which a registered server in a server center is located. The current server address list is a server address list which is updated in the server center last time.
In a specific implementation, a client acquires a current server address list corresponding to a distributed cluster from a server registration center through a preset address list manager.
Step 2: detecting whether the current server address list is consistent with the cluster server address list or not, and if not, acquiring network delay information of a server corresponding to each server address in the current server address list;
it should be noted that the network delay information generally refers to the round-trip time of sending a data packet from the user's computer to the web server and then immediately returning the data packet from the web server to the user's computer. In popular terms, it is the time taken for data to pass from the computer to the computer. The network delay in this embodiment refers to a network delay between the client and the Zookeeper server. The client can send the same ping command to all servers in the current server address list and then record the sending time t of the ping command1And a receiving time t of receiving the ping command feedback result4Then, each server record is obtained and fed back to the receiving time t of the ping command received by the client2And a return time t when a feedback result is returned to the client when the ping command response is finished3Finally, the client end sets the network delay as (t) according to the formula2-t1)+(t4-t3) And then the current network delay of each server can be calculated.
It should be understood that, in this embodiment, if the client detects that the current server address list is consistent with the cluster server address list, it indicates that the cluster server address list locally stored by the client does not need to be updated, otherwise, the cluster server address list needs to be updated.
In a specific implementation, if the client detects that the current server address list is inconsistent with the cluster server address list, network delay information of a server corresponding to each server address in the current server address list is obtained.
And step 3: sequentially adjusting the server addresses contained in the current server address list according to the network delay information to obtain a server address list to be cached;
it should be noted that, in this embodiment, the manner of sequentially adjusting the servers may be to perform size sorting on the network delays included in the network delay information in a sequence from small to large, and then sequentially adjust the server addresses included in the current server address list according to a sorting result, so as to obtain the server address list to be cached.
And 4, step 4: and caching the address list of the server to be cached as a new cluster server address list.
In a specific implementation, after the client obtains the address list of the server to be cached, the address list of the server to be cached can be used as a new cluster server address list for caching, so that the server address stored in the cluster server address list locally stored by the client can be ensured to be the latest server address, and the client can conveniently select the server address corresponding to the server with smaller network delay from the server address list.
Further, in order to ensure stable establishment of session connection and improve session connection efficiency, the session processing method based on the server load status in this embodiment further includes the following steps:
and 5: the method comprises the steps that a preset address list manager obtains the address list length corresponding to a locally pre-stored cluster server address list, detects whether the address list length is smaller than the preset length or not, and selects an available server address carrying a preset mark from the locally pre-stored cluster server address list if the address list length is smaller than the preset length;
it should be noted that in the ZooKeeper client session, the statichonsrovider is adopted as a default to implement the HostProvider interface, and the preset address list manager in this embodiment implements the HostProvider interface through the dynamhstprovider. In this embodiment, a pre-programmed hardware resource monitoring script program is stored in the preset address list manager: DynamicHostProvider class. In the DynamicHostProvider class, the next (long) method is a core method of the class and is also a core control module for load balancing of the client. And the subscript corresponding to the preset mark, namely the server address, is index.
In a specific implementation, when calling a next (long) spindelay method for the first time, the preset address list manager first obtains an address list length (index) corresponding to a locally pre-stored cluster server address list, initializes the index to 0, then detects whether the address list length is smaller than a preset length (before it is required to verify whether the address list length is empty), and if so, randomly selects an address within a specified address length range (i.e., the preset length), and then takes a server corresponding to the address as a target server.
Similarly, if the preset address list manager detects that the length of the address list is smaller than the preset length, an available server address carrying a preset label (index is subscript) is selected from a local pre-stored cluster server address list.
Step 6: and the preset address list manager verifies whether the server corresponding to the available server address is in a high-load state, and if not, a target server address is selected from the available server addresses.
In a specific implementation, the preset address list manager also verifies whether a server corresponding to the available server address is in a high load state, and selects a target server address from the available server addresses if the server is not in the high load state.
Considering that the server addresses in the cluster server address list are arranged from small to large according to the network delay, in this embodiment, the preset address list manager further selects a non-high-load server with the smallest network delay from the available server addresses as the target server, thereby ensuring stable establishment of session connection and improving session connection efficiency.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A session processing system based on server load status, the system comprising:
the client is used for acquiring a server to be connected corresponding to the session connection request when receiving the session connection request;
the client is also used for calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from a server registration center and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information;
the client is also used for selecting a target server address from a local pre-stored cluster server address list through a preset address list manager when the server to be connected does not meet the preset connection condition;
the client is also used for determining a corresponding target server according to the target server address and establishing session connection with the target server;
the client is further configured to obtain a current server address list corresponding to the distributed cluster from the server registration center through the preset address list manager;
the client is further used for detecting whether the current server address list is consistent with the cluster server address list, and if not, network delay information of a server corresponding to each server address in the current server address list is obtained;
the client is further configured to sequentially adjust the server addresses included in the current server address list according to the network delay information to obtain a server address list to be cached;
and the client is also used for caching the address list of the server to be cached as a new cluster server address list.
2. The system of claim 1, wherein the consolidated load information comprises: system load, central processing unit utilization rate, memory occupancy rate and disk utilization rate;
and the client is also used for judging whether the server to be connected meets preset connection conditions according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the disk utilization rate.
3. The system of claim 2, wherein the client is further configured to calculate, according to the system load, the utilization rate of the central processing unit, the memory occupancy rate, and the disk utilization rate, a comprehensive load value corresponding to the server to be connected through a preset formula;
the client is further used for determining a current load state corresponding to the server to be connected according to the comprehensive load value and judging whether the server to be connected meets a preset connection condition or not according to the current load state;
wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
wherein CHSLoad is the combined load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
4. The system of claim 1, wherein the client is further configured to invoke the preset thread to connect to the server registration center, monitor a registered server in the server registration center to obtain the comprehensive load information corresponding to the registered server, and read the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information.
5. The system according to claim 1, wherein the preset address list manager is configured to obtain an address list length corresponding to a locally pre-stored cluster server address list, and detect whether the address list length is smaller than the preset length, and if so, select an available server address carrying a preset flag from the locally pre-stored cluster server address list;
the preset address list manager is further configured to verify whether a server corresponding to the available server address is in a high load state, and if not, select a target server address from the available server addresses.
6. A session processing method based on server load state is characterized by comprising the following steps:
when a session connection request is received, acquiring a server to be connected corresponding to the session connection request;
calling a preset thread to acquire comprehensive load information corresponding to the server to be connected from a server registration center, and judging whether the server to be connected meets preset connection conditions or not according to the comprehensive load information;
when the server to be connected does not meet the preset connection condition, selecting a target server address from a local pre-stored cluster server address list through a preset address list manager;
determining a corresponding target server according to the target server address, and establishing session connection with the target server;
wherein the method further comprises:
acquiring a current server address list corresponding to the distributed cluster from the server registration center through the preset address list manager;
detecting whether the current server address list is consistent with the cluster server address list or not, and if not, acquiring network delay information of a server corresponding to each server address in the current server address list;
sequentially adjusting the server addresses contained in the current server address list according to the network delay information to obtain a server address list to be cached;
and caching the address list of the server to be cached as a new cluster server address list.
7. The method of claim 6, wherein the consolidated load information comprises: system load, central processing unit utilization rate, memory occupancy rate and disk utilization rate;
the step of judging whether the server to be connected meets the preset connection condition according to the comprehensive load information comprises the following steps:
and judging whether the server to be connected meets a preset connection condition or not according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the disk utilization rate.
8. The method according to claim 7, wherein the step of determining whether the server to be connected satisfies a predetermined connection condition according to the system load, the cpu utilization, the memory occupancy, and the disk utilization includes:
calculating a comprehensive load value corresponding to the server to be connected through a preset formula according to the system load, the utilization rate of the central processing unit, the memory occupancy rate and the utilization rate of the disk;
determining a current load state corresponding to the server to be connected according to the comprehensive load value, and judging whether the server to be connected meets a preset connection condition or not according to the current load state;
wherein the preset formula is as follows:
CHSLoad=θloadcpumemi/o
wherein CHSLoad is the combined load value, θloadTo system load, θcpuFor central processor utilization, thetamemFor memory occupancy, θi/oThe disk utilization.
9. The method of claim 6, wherein the step of calling a preset thread to obtain comprehensive load information corresponding to the server to be connected from a server registration center, and determining whether the server to be connected meets a preset connection condition according to the comprehensive load information comprises:
calling the preset thread to connect the server registration center, and monitoring the registered server in the server registration center to acquire comprehensive load information corresponding to the registered server;
and reading the comprehensive load information corresponding to the server to be connected from the obtained comprehensive load information, and judging whether the server to be connected meets a preset connection condition according to the read comprehensive load information.
CN201910670425.6A 2019-07-23 2019-07-23 Session processing system and method based on server load state Active CN110401708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910670425.6A CN110401708B (en) 2019-07-23 2019-07-23 Session processing system and method based on server load state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910670425.6A CN110401708B (en) 2019-07-23 2019-07-23 Session processing system and method based on server load state

Publications (2)

Publication Number Publication Date
CN110401708A CN110401708A (en) 2019-11-01
CN110401708B true CN110401708B (en) 2021-11-23

Family

ID=68325901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910670425.6A Active CN110401708B (en) 2019-07-23 2019-07-23 Session processing system and method based on server load state

Country Status (1)

Country Link
CN (1) CN110401708B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586139B (en) * 2020-04-30 2022-08-19 中国银行股份有限公司 Information transmission method and device based on echo state network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645925A (en) * 2009-05-15 2010-02-10 中国科学院声学研究所 Selection method of neighbor nodes related to physical topology in P2P system
CN102316133A (en) * 2010-07-01 2012-01-11 中国移动通信集团上海有限公司 Method and device for balancing load
CN104079630A (en) * 2014-06-09 2014-10-01 中国建设银行股份有限公司 Business server side load balancing method, client side, server side and system
US9648138B1 (en) * 2012-03-27 2017-05-09 Open Text Corporation Method and system for virtual server dormancy
CN107026907A (en) * 2017-03-30 2017-08-08 上海斐讯数据通信技术有限公司 A kind of load-balancing method, load equalizer and SiteServer LBS
CN108199909A (en) * 2018-03-30 2018-06-22 浙江网新恒天软件有限公司 A kind of High Availabitity SiteServer LBS based on consistency Hash
CN108696549A (en) * 2017-04-05 2018-10-23 北京京东尚科信息技术有限公司 Load-balancing method, device and system
CN110019481A (en) * 2017-12-28 2019-07-16 中国移动通信集团河北有限公司 Memory database access method, device, equipment and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10200447B2 (en) * 2015-09-23 2019-02-05 Citirix Systems, Inc. FTP load balancing support for cluster
US10412158B2 (en) * 2016-07-27 2019-09-10 Salesforce.Com, Inc. Dynamic allocation of stateful nodes for healing and load balancing

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645925A (en) * 2009-05-15 2010-02-10 中国科学院声学研究所 Selection method of neighbor nodes related to physical topology in P2P system
CN102316133A (en) * 2010-07-01 2012-01-11 中国移动通信集团上海有限公司 Method and device for balancing load
US9648138B1 (en) * 2012-03-27 2017-05-09 Open Text Corporation Method and system for virtual server dormancy
CN104079630A (en) * 2014-06-09 2014-10-01 中国建设银行股份有限公司 Business server side load balancing method, client side, server side and system
CN107026907A (en) * 2017-03-30 2017-08-08 上海斐讯数据通信技术有限公司 A kind of load-balancing method, load equalizer and SiteServer LBS
CN108696549A (en) * 2017-04-05 2018-10-23 北京京东尚科信息技术有限公司 Load-balancing method, device and system
CN110019481A (en) * 2017-12-28 2019-07-16 中国移动通信集团河北有限公司 Memory database access method, device, equipment and medium
CN108199909A (en) * 2018-03-30 2018-06-22 浙江网新恒天软件有限公司 A kind of High Availabitity SiteServer LBS based on consistency Hash

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A Service Discovery System based on Zookeeper with Priority Load Balance Strategy";Meina Song et al;《2016 IEEE International Conference on Network Infrastructure and Digital Content (IC-NIDC)》;20170713;全文 *
"客户端负载均衡算法研究及在即时通讯架构中的应用与实现";毛可嘉;《中国优秀硕士学位论文全文数据库(电子期刊)》;20180915;第6.3节 *

Also Published As

Publication number Publication date
CN110401708A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN107872402B (en) Global flow scheduling method and device and electronic equipment
US20140280488A1 (en) Automatic configuration of external services based upon network activity
US10389801B2 (en) Service request processing method, related apparatus, and system
US20050021771A1 (en) System enabling server progressive workload reduction to support server maintenance
JP2005530372A5 (en)
GB2532834A (en) A method and system for scalable job processing
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
CN115004673A (en) Message pushing method and device, electronic equipment and computer readable medium
US10986172B2 (en) Configurable connection reset for customized load balancing
CN106533961B (en) Flow control method and device
CN114153581A (en) Data processing method, data processing device, computer equipment and storage medium
CN112416594A (en) Micro-service distribution method, electronic equipment and computer storage medium
CN110311963B (en) Message pushing method and device, computer equipment and computer readable storage medium
CN110401708B (en) Session processing system and method based on server load state
CN109842518B (en) Content distribution network disaster tolerance method and device, computer equipment and storage medium
CN111835797A (en) Data processing method, device and equipment
CN111597041B (en) Calling method and device of distributed system, terminal equipment and server
CN111752728B (en) Message transmission method and device
CN110808967B (en) Detection method for challenging black hole attack and related device
WO2011035608A1 (en) Data query system and constructing method thereof and corresponding data query method
JP2002091910A (en) Web server request classification system for classifying request based on user behavior and prediction
CN115277599A (en) Backflow method and device in current-limiting scene, computer equipment and storage medium
CN108718285B (en) Flow control method and device of cloud computing cluster and server
CN114490071A (en) Resource scheduling method, device, equipment and medium based on cloud game
CN113596119A (en) Edge capability distribution method, system, device and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191101

Assignee: Zhierkang (Yunnan) Technology Development Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000211

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230704

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191101

Assignee: Yunnan chaisen Technology Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000228

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230707

Application publication date: 20191101

Assignee: Luoyang Hualiang Engineering Design Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000231

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230707

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191101

Assignee: Kunming Fangmei Technology Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000237

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230710

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191101

Assignee: Yunnan Benyi Data Service Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000241

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230713

Application publication date: 20191101

Assignee: Yunnan Yuantongyi Technology Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023420000242

Denomination of invention: A Session Processing System and Method Based on Server Load State

Granted publication date: 20211123

License type: Common License

Record date: 20230713

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191101

Assignee: Anhui Xiangshang Technology Service Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023980054625

Denomination of invention: A Session Processing System and Method Based on Server Load Status

Granted publication date: 20211123

License type: Common License

Record date: 20240103

Application publication date: 20191101

Assignee: Anhui Xiangzhi Information Technology Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023980054624

Denomination of invention: A Session Processing System and Method Based on Server Load Status

Granted publication date: 20211123

License type: Common License

Record date: 20240103

Application publication date: 20191101

Assignee: HEFEI MUZHI INFORMATION TECHNOLOGY CO.,LTD.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023980054622

Denomination of invention: A Session Processing System and Method Based on Server Load Status

Granted publication date: 20211123

License type: Common License

Record date: 20240103

Application publication date: 20191101

Assignee: Anhui Terze Technology Co.,Ltd.

Assignor: SOUTH CENTRAL University FOR NATIONALITIES

Contract record no.: X2023980054620

Denomination of invention: A Session Processing System and Method Based on Server Load Status

Granted publication date: 20211123

License type: Common License

Record date: 20240103