CN105007328A - Network cache design method based on consistent hash - Google Patents
Network cache design method based on consistent hash Download PDFInfo
- Publication number
- CN105007328A CN105007328A CN201510457562.3A CN201510457562A CN105007328A CN 105007328 A CN105007328 A CN 105007328A CN 201510457562 A CN201510457562 A CN 201510457562A CN 105007328 A CN105007328 A CN 105007328A
- Authority
- CN
- China
- Prior art keywords
- node
- hash
- server
- space
- server cluster
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Abstract
The invention discloses a network cache design method based on consistent hash. The method comprises the following steps that the caches of a server cluster are centrally put in a unified resource pool, all resources in the resource pool can be scheduled by any one resource, and an NUMA (Non Uniform Memory Access Architecture) is adopted to manage the caches; a hash value is put in an annular space of 2 m, and the single server is regarded as an object to carry out hash calculation to be put in a hash ring; and a corresponding key value is computed by a data block through a hash algorithm and is put into a hash space. The technology of the invention is used for buffer sharing and buffer balancing of the server cluster, the large-scale data access speed can be accelerated, the influence of single-node cache invalidation can be eliminated, the IO (Input Output) performance of the server cluster can be effectively improved, a unified storage space is not only provided, but the caches can be relatively uniformly distributed in each server node.
Description
Technical field
The present invention relates to technical field of the computer network, be specifically related to a kind of network cache method for designing based on consistent hashing, buffering for server cluster is shared and buffer memory equilibrium, the main impact accelerated large-scale data access speed and eliminate single node cache invalidation.The present invention effectively can improve the IO performance of server cluster, not only provides unified memory space, and relatively uniform for buffer memory can be distributed in each server node.
Background technology
In traditional server cluster, in order to realize load balancing, N station server being carried out hash delivery, is that the request of data of X is distributed or is routed to hash(X by key assignments) in server corresponding to mod N.
This algorithm is very simple, but if add the quantity of server, by causing original data cachedly to remap, causing server cluster to read the situation of hard disc data in a large number, causing very large system load.Therefore the caching design scheme of traditional approach is adopted cannot to carry out dynamic capacity-expanding to existing cluster.
If there is Single-Server node failure in server cluster, so remove this node and data cached and server also can be caused not mate, therefore result in data cached resource acute variation, have impact on the overall performance of system.
Summary of the invention
The technical problem to be solved in the present invention is: in view of the above problems, main purpose of the present invention is, a kind of network cache method for designing based on consistent hashing algorithm is provided, the buffering that the method may be used for server cluster is shared and buffer memory equilibrium, the main impact accelerated large-scale data access speed and eliminate single node cache invalidation.
The technical solution adopted in the present invention is:
Based on a network cache method for designing for consistent hashing, first concentrated by the buffer memory of server cluster, put into unified resource pool, all resources in resource pool can be used by arbitrary scheduling of resource, adopt NUMA to carry out the management of buffer memory; Hash value is put into one 2
mannular space in, single server is also regarded as object carry out hash calculate put into hash ring; Then data block is calculated corresponding key value by hash algorithm, this value is put in hash space.
The machine if certain node is delayed, this node failure, the data block originally pointing to this node is cached in another node again, and other data blocks are still cached in original node;
If server cluster needs dilatation or alternative failure node, the data block originally pointing to failure node is again cached to and newly increases in node, and other data blocks are still cached in original node.
Physical node is obtained dummy node by algorithm by described method, and dummy node is mapped to hash space.
The concrete setting up procedure of described dummy node is: by one of them Node node, obtains the name of Key value, then by 2 by hash algorithm
mthe value of-key, as the name of new key value, fictionalizes two nodes, is uniformly distributed during two nodes in hash space; In like manner, other nodes are also identical calculations, are mapped in hash space by the dummy node of acquisition.
Beneficial effect of the present invention is:
The buffering that the technology of the present invention is used for server cluster is shared and buffer memory equilibrium, the impact of large-scale data access speed and elimination single node cache invalidation can be accelerated, effectively can improve the IO performance of server cluster, unified memory space is not only provided, and relatively uniform for buffer memory can be distributed in each server node.
Accompanying drawing explanation
Fig. 1 is that server cluster cache resources sets up cache pool schematic diagram;
Fig. 2 is that data block is mapped to uniform spaces schematic diagram by Hash;
Fig. 3 is that server is mapped to uniform spaces schematic diagram by Hash;
Fig. 4 is for deleting server operation schematic diagram;
Fig. 5 is for adding server operation schematic diagram;
Fig. 6 is data block distribution schematic diagram when not adding virtual server;
Fig. 7 is data block distribution schematic diagram after interpolation virtual server;
Fig. 8 is data block distribution schematic diagram when not adding virtual server;
Fig. 9 is data block distribution schematic diagram after interpolation virtual server.
Embodiment
With reference to the accompanying drawings, by embodiment, the present invention is further described:
Embodiment 1:
Based on a network cache method for designing for consistent hashing, first concentrated by the buffer memory of server cluster, put into unified resource pool, all resources in resource pool can be used by arbitrary scheduling of resource, adopt NUMA to carry out the management of buffer memory; Hash value is put into one 2
mannular space in, single server is also regarded as object carry out hash calculate put into hash ring; Then data block Object A, B, C and D are calculated corresponding key value by hash algorithm, this value is put in hash space; Just server node and data block are all mapped in same hash space by above two operations, then according to clockwise direction, data block are put in corresponding server node, as shown in Figure 2 and Figure 3.
Server cluster is concentrated in together by multiple servers to provide service, but be a station server in client.Cluster can carry out parallel work-flow, and clustering operation can reduce the impact of Single Point of Faliure, and achieves the resources effective utilization of clustering.If there is N station server cluster, so N is expanded doubly to its buffer memory arbitrary server, shown in Fig. 1, because buffer memory in cache pool is for arbitrary server, (local cache access speed is fast all to there is different access speeds, non-local cache access speed is slow), therefore adopt NUMA to carry out the management of buffer memory.
NUMA (Non Uniform Memory Access Architecture) technology can make numerous server operate as triangular web, retains the advantage that mini system is convenient to programme and manage simultaneously.Nonuniform memory access (NUMA) is the design of a kind of computer memory body for multiprocessor, and memory access time depends on the core position of processor.Under NUMA, the speed ratio non-local memory of its local storage of processor access (processor shared between the place of memory to another processor or memory) sooner.
Embodiment 2:
On the basis of embodiment 1, in the present embodiment, for the operation of arbitrary cluster, all there is single server to delay the situation of machine, but the server machine of delaying can not affect performance and the service of cluster, therefore need the deletion of server and be added to line operate, if occur in server cluster, a certain station server is delayed machine, its cache contents lost efficacy, and have impact on the work of whole server, so will occur that buffer memory moves; In like manner, when the quantity of server cluster does not meet the demands, cannot provide enough services for the external world, need to add number of nodes and carry out dilatation, process is as follows:
The machine if N2 node is delayed, this node failure, as shown in Figure 4, data block A and the B originally pointing to N2 needs again to be cached in N3, there will be buffer memory migration, but data block C and D is still cached in original node, therefore there will not be data all to move, decrease the consumption of system resource;
If server cluster needs dilatation or alternative failure node, as N4 node adds server cluster to, as shown in Figure 5, the data block A originally pointing to N3 needs again to be cached in N4, there will be buffer memory migration, but data block B, C and D are still cached in original node, therefore there will not be data all to move, decrease the consumption of system resource equally.
Embodiment 3
On the basis of embodiment 1 or 2, described in the present embodiment, physical node is obtained dummy node by algorithm by method, and dummy node is mapped to hash space, the interpolation of dummy node can avoid single server node and occur a large amount of data buffer storages, achieves the equally loaded of data.
Embodiment 4
On the basis of embodiment 3, described in the present embodiment, the concrete setting up procedure of dummy node is:
Node1 is obtained Key value called after VN1, then by 2 by hash algorithm
mthe value of-key, as new key value, obtains new node called after VN4. and node 1 fictionalizes two nodes in node, is uniformly distributed during two nodes in hash space.In like manner, be also identical calculations for Node2 and Node3, such three physical nodes become 6 dummy nodes, are mapped in hash space by 6 dummy nodes.The original buffer memory (as Suo Shi Fig. 6, Fig. 8) concentrated can be seen, can be relatively uniform be distributed in 3 physical nodes, as shown in Fig. 7, Fig. 9.
Above execution mode is only for illustration of the present invention; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.
Claims (4)
1. the network cache method for designing based on consistent hashing, it is characterized in that: first the buffer memory of server cluster is concentrated, put into unified resource pool, all resources in resource pool can be used by arbitrary scheduling of resource, adopt NUMA to carry out the management of buffer memory; Hash value is put into one 2
mannular space in, single server is also regarded as object carry out hash calculate put into hash ring; Then data block is calculated corresponding key value by hash algorithm, this value is put in hash space.
2. a kind of network cache method for designing based on consistent hashing according to claim 1, it is characterized in that: the machine if certain node is delayed, this node failure, the data block originally pointing to this node is cached in another node again, and other data blocks are still cached in original node;
If server cluster needs dilatation or alternative failure node, the data block originally pointing to failure node is again cached to and newly increases in node, and other data blocks are still cached in original node.
3. a kind of network cache method for designing based on consistent hashing according to claim 1 and 2, is characterized in that: physical node is obtained dummy node by algorithm by described method, and dummy node is mapped to hash space.
4. a kind of network cache method for designing based on consistent hashing according to claim 3, it is characterized in that, the concrete setting up procedure of described dummy node is: by one of them Node node, obtains the name of Key value, then by 2 by hash algorithm
mthe value of-key, as the name of new key value, fictionalizes two nodes, is uniformly distributed during two nodes in hash space; In like manner, other nodes are also identical calculations, are mapped in hash space by the dummy node of acquisition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510457562.3A CN105007328A (en) | 2015-07-30 | 2015-07-30 | Network cache design method based on consistent hash |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510457562.3A CN105007328A (en) | 2015-07-30 | 2015-07-30 | Network cache design method based on consistent hash |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105007328A true CN105007328A (en) | 2015-10-28 |
Family
ID=54379846
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510457562.3A Pending CN105007328A (en) | 2015-07-30 | 2015-07-30 | Network cache design method based on consistent hash |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105007328A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106503139A (en) * | 2016-10-20 | 2017-03-15 | 上海携程商务有限公司 | Dynamic data access method and system |
CN107851062A (en) * | 2015-12-31 | 2018-03-27 | 华为技术有限公司 | Buffer memory management method and main frame in a kind of mainframe cluster |
CN108124012A (en) * | 2017-12-21 | 2018-06-05 | 中通服公众信息产业股份有限公司 | A kind of distributed caching computational methods based on hash algorithm |
CN109739930A (en) * | 2018-12-19 | 2019-05-10 | 平安普惠企业管理有限公司 | Date storage method, device based on distributed cache system, computer equipment |
WO2020073539A1 (en) * | 2018-10-12 | 2020-04-16 | 山东科技大学 | Performance optimization method for distributed cache server cluster |
CN112788082A (en) * | 2019-11-08 | 2021-05-11 | 内江市下一代互联网数据处理技术研究所 | High-availability memory caching system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104050270A (en) * | 2014-06-23 | 2014-09-17 | 成都康赛信息技术有限公司 | Distributed storage method based on consistent Hash algorithm |
CN104202349A (en) * | 2009-12-31 | 2014-12-10 | 华为技术有限公司 | Method, device and system of scheduling of distributed cache resources |
-
2015
- 2015-07-30 CN CN201510457562.3A patent/CN105007328A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104202349A (en) * | 2009-12-31 | 2014-12-10 | 华为技术有限公司 | Method, device and system of scheduling of distributed cache resources |
CN104050270A (en) * | 2014-06-23 | 2014-09-17 | 成都康赛信息技术有限公司 | Distributed storage method based on consistent Hash algorithm |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107851062A (en) * | 2015-12-31 | 2018-03-27 | 华为技术有限公司 | Buffer memory management method and main frame in a kind of mainframe cluster |
CN106503139A (en) * | 2016-10-20 | 2017-03-15 | 上海携程商务有限公司 | Dynamic data access method and system |
CN108124012A (en) * | 2017-12-21 | 2018-06-05 | 中通服公众信息产业股份有限公司 | A kind of distributed caching computational methods based on hash algorithm |
WO2020073539A1 (en) * | 2018-10-12 | 2020-04-16 | 山东科技大学 | Performance optimization method for distributed cache server cluster |
CN109739930A (en) * | 2018-12-19 | 2019-05-10 | 平安普惠企业管理有限公司 | Date storage method, device based on distributed cache system, computer equipment |
CN112788082A (en) * | 2019-11-08 | 2021-05-11 | 内江市下一代互联网数据处理技术研究所 | High-availability memory caching system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105007328A (en) | Network cache design method based on consistent hash | |
US9372726B2 (en) | Gang migration of virtual machines using cluster-wide deduplication | |
EP3334123B1 (en) | Content distribution method and system | |
US9052824B2 (en) | Content addressable stores based on sibling groups | |
Tziritas et al. | Application-aware workload consolidation to minimize both energy consumption and network load in cloud environments | |
CN102521038B (en) | Virtual machine migration method and device based on distributed file system | |
US9195599B2 (en) | Multi-level aggregation techniques for memory hierarchies | |
US9208094B2 (en) | Managing and sharing storage cache resources in a cluster environment | |
US20150127649A1 (en) | Efficient implementations for mapreduce systems | |
Deshpande et al. | Gang migration of virtual machines using cluster-wide deduplication | |
US11245774B2 (en) | Cache storage for streaming data | |
Tziritas et al. | Data replication and virtual machine migrations to mitigate network overhead in edge computing systems | |
Wang et al. | Ada-Things: An adaptive virtual machine monitoring and migration strategy for internet of things applications | |
CN104536724A (en) | Hash table concurrent access performance optimization method under multi-core environment | |
CN103795801A (en) | Metadata group design method based on real-time application group | |
CN110427270B (en) | Dynamic load balancing method for distributed connection operator in RDMA (remote direct memory Access) network | |
CN102279810A (en) | Network storage server and method for caching data | |
CN105094751A (en) | Memory management method used for parallel processing of streaming data | |
CN103918239A (en) | Load balancing method, device, system and computer readable medium | |
TW201405308A (en) | Systems and methods for s-list partitioning | |
CN105760391B (en) | Method, data node, name node and system for dynamically redistributing data | |
Ye et al. | A two-layer geo-cloud based dynamic replica creation strategy | |
CN102970349B (en) | A kind of memory load equalization methods of DHT network | |
US11494301B2 (en) | Storage system journal ownership mechanism | |
CN104219163A (en) | Load balancing method for node dynamic forward based on dynamic replication method and virtual node method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into 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: 20151028 |