CN101369923A - Method for improving cluster web service performance by using distributed hash table - Google Patents

Method for improving cluster web service performance by using distributed hash table Download PDF

Info

Publication number
CN101369923A
CN101369923A CNA2008102117565A CN200810211756A CN101369923A CN 101369923 A CN101369923 A CN 101369923A CN A2008102117565 A CNA2008102117565 A CN A2008102117565A CN 200810211756 A CN200810211756 A CN 200810211756A CN 101369923 A CN101369923 A CN 101369923A
Authority
CN
China
Prior art keywords
distributed hashtable
master control
web service
hashtable
distributed
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.)
Granted
Application number
CNA2008102117565A
Other languages
Chinese (zh)
Other versions
CN101369923B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008102117565A priority Critical patent/CN101369923B/en
Publication of CN101369923A publication Critical patent/CN101369923A/en
Application granted granted Critical
Publication of CN101369923B publication Critical patent/CN101369923B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for improving a cluster web service performance by a distributed hash table. A series of collocations are arranged in a web service startup collocation comprising: collocating a distributed hash table name, collocating a broadcast address and port, collocating a static state content list, adding a static state content loading timing task object and collocating a static state content loading timing interval. When the cluster web service is started up, the system automatically generates the distributed hash table with a same name for each cluster node according to relative collocations, then loads the static state content to be loaded in each distributed hash table. When the web service operates, the timing or active activation of the synchronization function of the distributed hash table can make the static state content of each cluster node to maintain synchronous update. The method of the invention enables the cluster technology and the static state content technology simultaneous for enhancing the web service performance, so that the system redundancy is stable as well as the system pressure is lightened.

Description

A kind of method of using distributed hashtable to improve cluster web service performance
Technical field
The invention belongs to web service applied technical field, particularly a kind of method of using distributed hashtable to improve cluster web service performance.
Background technology
In today that the web service is propagated its belief on a large scale, the service that differs from one another is integrated in the web service one after another, service is used for the web of hot topic, and huge visit capacity comprises that to the web whole system logical process server, database server etc. on web server, backstage all are huge tests.And, in case user's access request can not get timely response, will non-constant for user's experience of pursuing net surfing rapidly.
For relaxing this contradiction, except improving according to traffic carrying capacity the performance of hardware service, share service request such as adopting the web service cluster, set about from software, method, also be one of important channel of under the existing hardware condition, improving performance, such as adopting means such as caching technology, static content technology.Clustering is a mode common in the web service arrangement, adopts the performance that the inefficacy forwarding brought into play after this mode and load-balancing function can fine enhancing web service.The static content technology then is the user to be needed often visit but change not frequent content to use static mode to offer the user after being loaded into internal memory, avoid each visit all to obtain from database or other services, such mode can alleviate the load of backstage service greatly, and user's experience also is improved.
From unilaterally, Clustering and static content technology all are the important means that strengthens the web performance, if but use the former, consistency for the experience result that guarantees the user, just the static content technology can not be adopted, the pressure that the web system comprises assemblies such as logical process, database service can't be alleviated; Only use the latter, can not enjoy system redundancy stability and the hardware that the inefficacy forwarding brings in the Clustering and strengthening the performance leap that brings.But, when being applied in these two kinds of technology combinations in the web service simultaneously, just produced a problem.Each node in the cluster all is separately the web service that moves voluntarily, and static content all is in the service that is carried in separately, if the static content unanimity of each node, it is identical being forwarded to the result that user's request of each node returns.If the content that static page loads changes, the content in each node that then needs to upgrade in time, otherwise the information that returns to the user from the different nodes of cluster just can not be consistent.Therefore, how having guaranteed to adopt can be in time synchronous after the renewal of the static content of each node in the web cluster service of static content mode, is the problem that must solve when Clustering and static content technology are applied to the web service simultaneously.
Summary of the invention
The present invention is directed to and be applied to exist when web serves each node content to be difficult to synchronous problem in time simultaneously Clustering and static content technology, a kind of method of using distributed hashtable to improve cluster web service performance is proposed, can make the static content of each clustered node keep upgrading synchronously effectively, thereby realize Clustering and static content technology are applied to the web service simultaneously to improve the performance of cluster web service.
For solving the problems of the technologies described above, the use distributed hashtable that the present invention proposes improves the method for cluster web service performance, starts in the web service and carries out following configuration in the configuration:
(1) configuring distributed Hash table title is used for when system start-up the distributed hashtable of unique name in the structure network segment;
(2) configuration broadcast address and port are used for communication between the distributed hashtable;
(3) configuring static contents list is used for the distributed hashtable controller object and according to list configuration the corresponding static load content is arrived distributed hashtable;
(4) the interpolation static content loads the timed task object, and configuring static content loading fixed time interval, is used for regularly calling the distributed hashtable controller object distributed hashtable is carried out static content loading and renewal.
When the web service started, system generated the distributed hashtable that title is identical automatically according to relevant each clustered node that is configured to, and the static content that will need then to load is loaded in each distributed hashtable.
When the web service operation, regularly or the synchronizing function that initiatively activates distributed hashtable make the static content of each clustered node keep renewal synchronously.
Further, when loading static content in the web service activation process, the static content that at first will need to load is loaded in the master control distributed hashtable, notifies all the other non-master control distributed hashtables to carry out static content by the master control distributed hashtable again and loads.Described master control distributed hashtable is the distributed hashtable of the clustered node that starts at first, and the master control distributed hashtable is unique in the network segment, and the distributed hashtable of other clustered nodes is non-master control distributed hashtable.
Further, when in web service operation process, upgrading static content, at first upgrade the static content in the master control distributed hashtable, notify all the other non-master control distributed hashtables to carry out static content by the master control distributed hashtable again and upgrade.
The inventive method is by using distributed hashtable, reached the purpose that static content upgrades in time synchronously at each clustered node, thereby these two kinds of means of the Clustering of making and static content technology can be used to strengthen the web service performance simultaneously, in mitigation system pressure, also can make system redundancy stable, and can not have influence on the consistency of user experience.
Description of drawings
Fig. 1 loads the cluster web service structure schematic diagram of static content for using distributed hashtable;
Fig. 2 upgrades the schematic diagram of static content for using distributed hashtable;
Distributed hashtable loaded static content and is synchronized to the sequential chart of other clustered node when Fig. 3 started for web service;
Fig. 4 regularly upgrades static content for distributed hashtable and is synchronized to the sequential chart of other clustered node.
Embodiment
Reach technological means and the effect that predetermined purpose is taked for further setting forth the present invention, below in conjunction with drawings and Examples, the method that the use distributed hashtable that the present invention is proposed improves cluster web service performance is described in detail as follows.
For using distributed hashtable to improve cluster web service performance, the present invention is carrying out a series of configurations starting in the configuration in web service, comprises configuring distributed Hash table title, configuration broadcast address and port, configuring static contents list, adds static content and load timed task object and configuring static content loading fixed time interval etc.When the cluster web service starts, system generates the distributed hashtable that title is identical automatically according to relevant each clustered node that is configured to, wherein the distributed hashtable of the clustered node that starts at first becomes the master control distributed hashtable automatically, and the distributed hashtable of other clustered nodes of follow-up startup all becomes non-master control distributed hashtable.
Fig. 1 is that the present invention uses distributed hashtable to load the cluster web service structure schematic diagram of static content.As shown in the figure, each clustered node all has a name to be called the distributed hashtable of A, and keeps identical static content by start-up loading with synchronous renewal in service.
Fig. 2 is to use distributed hashtable to upgrade the schematic diagram of static content.As shown in the figure, after static content changes, system judges at first whether the distributed hashtable of this node is the master control distributed hashtable, if then upgrade the static content of this distributed hashtable, otherwise upgrades after receiving the broadcast announcement of master control distributed hashtable by the time again.Among Fig. 2, the distributed hashtable of the 2nd web clustered node is the master control distributed hashtable.
When the cluster web service starts, the process that distributed hashtable of the present invention loads static content and is synchronized to other clustered node as shown in Figure 3, detailed process is as follows:
Step 301, during startup, the Servlet object reference of registration reads the web configuration object in the web service starts;
Step 302, read the web configuration object after, read the static content tabulation that will load according to configuration file;
Step 303 starts static content and loads the timed task object, includes in the timing queue management;
Step 304, static content loads the timed task object and starts also single exampleization distributed hashtable controller object, distributed hashtable controller object initialization distributed hash table object, the title of distributed hash table object reads from configuration file, unique in the network segment, promptly the distributed hashtable object oriented in each node of cluster is identical;
Step 305, distributed hashtable controller object judge whether initialized distributed hashtable is the master control distributed hashtable.If not then entering the broadcast of waiting for the master control distributed hashtable; If execution in step 306 then;
Step 306, distributed hashtable controller object be according to the static content configured list, reads corresponding contents and generate static object to be loaded in the master control distributed hashtable from database;
Step 307, the master control distributed hashtable notifies the non-master control distributed hashtable of the same title in this network segment to load static content with broadcast mode.After receiving broadcast, non-master control distributed hash table object initiatively goes to obtain in the master control distributed hashtable content and loads, thereby finishes in the cluster all nodes to the loading of static content.
After all clustered nodes loading static contents finished, system entered regularly and upgrades in the control of distributed hashtable content.If certain clustered node web service is normally closed or operation exception causes closing, Servlet intercepts object will remove timed task, and distribution of notifications formula Hash table controller object discharges the distributed hashtable of this node.If this node is a main controlled node, then take over the role of main controlled node by the another one node, the master control distributed hashtable that guarantees cluster web service in the network segment has and is unique, and it is taken over mechanism and can adopt to increase income and organize the relevant existing way of jroups.
In the cluster web service operation, the timing of static content task arrives or static content is reloaded in the active activation if load, the process that distributed hashtable of the present invention upgrades static content and is synchronized to other clustered node as shown in Figure 4, detailed process is as follows:
Step 40l, static content load timed task object acquisition distributed hashtable controller object;
Step 402, distributed hashtable controller object judge whether initialized distributed hashtable is the master control distributed hashtable.If not then entering the broadcast of waiting for the master control distributed hashtable; If execution in step 403 then;
Step 403, distributed hashtable controller object be according to the static content configured list, reading of content and upgrade static object and be re-loaded in the master control distributed hashtable again from database;
Step 404, the master control distributed hashtable notifies the non-master control distributed hashtable of the same title in this network segment to upgrade static content with broadcast mode.After receiving broadcast, non-master control distributed hash table object initiatively goes to obtain in the master control distributed hashtable content and loads, thereby finishes in the cluster all nodes to the renewal of static content.
In web service operation process, if certain clustered node web service is normally closed or operation exception causes closing, Servlet intercepts object will remove timed task, and distribution of notifications formula Hash table controller object discharges the distributed hashtable of this node; If this node is a main controlled node, then take over the role of main controlled node by the another one node, the master control distributed hashtable that guarantees cluster web service in the network segment has and is unique, and it is taken over mechanism and can adopt to increase income and organize the relevant existing way of jroups.
Among the present invention, the distributed hashtable controller object can be implemented in by the put method of calling distributed hashtable increases static data in the distributed hashtable, can be implemented in by the remove method of calling distributed hashtable and delete static data in the distributed hashtable, remove that can be by successively calling distributed hashtable and put method are implemented in upgrades static data in the distributed hashtable, these methods all are to increase income to organize the prior art of the relevant distributed hashtable of jroups.
Explanation by embodiment, when can being to reach technological means and the effect that predetermined purpose takes to be able to more deeply and concrete understanding to the present invention, yet embodiment and appended diagram only provide with reference to the usefulness of explanation, be not to be used for the present invention is limited.

Claims (8)

1. a method of using distributed hashtable to improve cluster web service performance is characterized in that, starts in the web service and carries out following configuration in the configuration:
(1) configuring distributed Hash table title is used for when system start-up the distributed hashtable of unique name in the structure network segment;
(2) configuration broadcast address and port are used for communication between the distributed hashtable;
(3) configuring static contents list is used for the distributed hashtable controller object and according to list configuration the corresponding static load content is arrived distributed hashtable;
(4) the interpolation static content loads the timed task object, and configuring static content loading fixed time interval, is used for regularly calling the distributed hashtable controller object distributed hashtable is carried out static content loading and renewal;
When the web service started, system generated the distributed hashtable that title is identical automatically according to relevant each clustered node that is configured to, and the static content that will need then to load is loaded in each distributed hashtable;
When the web service operation, regularly or the synchronizing function that initiatively activates distributed hashtable make the static content of each clustered node keep renewal synchronously.
2. improve the method for cluster web service performance according to the described use distributed hashtable of claim 1, it is characterized in that, when in the web service activation process, loading static content, the static content that at first will need to load is loaded in the master control distributed hashtable, notifies all the other non-master control distributed hashtables to carry out static content by the master control distributed hashtable again and loads; Described master control distributed hashtable is the distributed hashtable of the clustered node that starts at first.
3. improve the method for cluster web service performance according to the described use distributed hashtable of claim 2, it is characterized in that, when in web service operation process, upgrading static content, at first upgrade the static content in the master control distributed hashtable, notify all the other non-master control distributed hashtables to carry out static content by the master control distributed hashtable again and upgrade.
4. improve the method for cluster web service performance according to claim 1,2 or 3 described use distributed hashtables, it is characterized in that the detailed process that loads static content when the web service starts comprises the steps:
Step 301, during startup, the Servlet object reference of registration reads the web configuration object in the web service starts;
Step 302, read the web configuration object after, read the static content tabulation that will load according to configuration file;
Step 303 starts static content and loads the timed task object, includes in the timing queue management;
Step 304, static content are loaded the timed task object and are started also single exampleization distributed hashtable controller object, distributed hashtable controller object initialization distributed hash table object, and the title of distributed hash table object reads from configuration file;
Step 305, distributed hashtable controller object judge whether initialized distributed hashtable is the master control distributed hashtable, if not then entering the broadcast of waiting for the master control distributed hashtable, if execution in step 306 then;
Step 306, distributed hashtable controller object be according to the static content configured list, reads corresponding contents and generate static object to be loaded in the master control distributed hashtable from database;
Step 307, the master control distributed hashtable notifies the non-master control distributed hashtable of the same title in this network segment to load static content with broadcast mode; After receiving broadcast, non-master control distributed hash table object initiatively goes to obtain in the master control distributed hashtable content and loads.
5. improve the method for cluster web service performance according to claim 1,2 or 3 described use distributed hashtables, it is characterized in that the detailed process of upgrading static content in web service operation process comprises the steps:
Step 401, static content load timed task object acquisition distributed hashtable controller object;
Step 402, distributed hashtable controller object judge whether initialized distributed hashtable is the master control distributed hashtable, if not then entering the broadcast of waiting for the master control distributed hashtable, if execution in step 403 then;
Step 403, distributed hashtable controller object be according to the static content configured list, reading of content and upgrade static object and be re-loaded in the master control distributed hashtable again from database;
Step 404, the master control distributed hashtable notifies the non-master control distributed hashtable of the same title in this network segment to upgrade static content with broadcast mode; After receiving broadcast, non-master control distributed hash table object initiatively goes to obtain in the master control distributed hashtable content and upgrades.
6. improve the method for cluster web service performance according to the described use distributed hashtable of claim 4, it is characterized in that, the detailed process of upgrading static content in web service operation process comprises the steps:
Step 401, static content load timed task object acquisition distributed hashtable controller object;
Step 402, distributed hashtable controller object judge whether initialized distributed hashtable is the master control distributed hashtable, if not then entering the broadcast of waiting for the master control distributed hashtable, if execution in step 403 then;
Step 403, distributed hashtable controller object be according to the static content configured list, reading of content and upgrade static object and be re-loaded in the master control distributed hashtable again from database;
Step 404, the master control distributed hashtable notifies the non-master control distributed hashtable of the same title in this network segment to upgrade static content with broadcast mode; After receiving broadcast, non-master control distributed hash table object initiatively goes to obtain in the master control distributed hashtable content and upgrades.
7. improve the method for cluster web service performance according to the described use distributed hashtable of claim 5, it is characterized in that, in web service operation process, when certain clustered node web service is closed, Servlet intercepts object and removes timed task, and distribution of notifications formula Hash table controller object discharges the distributed hashtable of this node.
8. improve the method for cluster web service performance according to the described use distributed hashtable of claim 6, it is characterized in that, in web service operation process, when certain clustered node web service is closed, Servlet intercepts object and removes timed task, and distribution of notifications formula Hash table controller object discharges the distributed hashtable of this node.
CN2008102117565A 2008-09-24 2008-09-24 Method for improving cluster web service performance by using distributed hash table Active CN101369923B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008102117565A CN101369923B (en) 2008-09-24 2008-09-24 Method for improving cluster web service performance by using distributed hash table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008102117565A CN101369923B (en) 2008-09-24 2008-09-24 Method for improving cluster web service performance by using distributed hash table

Publications (2)

Publication Number Publication Date
CN101369923A true CN101369923A (en) 2009-02-18
CN101369923B CN101369923B (en) 2010-12-29

Family

ID=40413562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008102117565A Active CN101369923B (en) 2008-09-24 2008-09-24 Method for improving cluster web service performance by using distributed hash table

Country Status (1)

Country Link
CN (1) CN101369923B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103583025A (en) * 2011-03-30 2014-02-12 日本电气英富醍株式会社 Data communication system, data communication terminal, data communication method, and computer program
WO2014101424A1 (en) * 2012-12-28 2014-07-03 华为技术有限公司 Method and system for synchronizing distributed database
CN104021033A (en) * 2014-06-23 2014-09-03 中国银行股份有限公司 Method and system for hashing busy processing nodes
CN105407114A (en) * 2014-08-29 2016-03-16 北京信威通信技术股份有限公司 Client and method for processing Zookeeper cluster data
CN106685688A (en) * 2016-09-26 2017-05-17 深圳市潮流网络技术有限公司 Cluster computer device synchronous upgrade method
CN107291710A (en) * 2016-03-30 2017-10-24 杭州海康威视数字技术股份有限公司 A kind of method and device updated the data for distributed data base system
CN107431881A (en) * 2015-02-24 2017-12-01 苹果公司 Periphery perceives networking data path back and forth and coexisted
CN107453994A (en) * 2016-05-30 2017-12-08 北京信威通信技术股份有限公司 Data transmission method and device based on DHT networks
CN109165321A (en) * 2018-07-28 2019-01-08 华中科技大学 A kind of consistency Hash table construction method and system based on nonvolatile memory

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1281027C (en) * 2003-12-04 2006-10-18 上海交通大学 Collaborative filtering recommendation approach for dealing with ultra-mass users
CN101193031B (en) * 2006-11-24 2011-05-25 曲锐 Data processing method and network based on distributed hash table
CN101094244A (en) * 2007-07-06 2007-12-26 中国人民解放军国防科学技术大学 Method of high performance distributed Hash table in P2P system

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103583025A (en) * 2011-03-30 2014-02-12 日本电气英富醍株式会社 Data communication system, data communication terminal, data communication method, and computer program
WO2014101424A1 (en) * 2012-12-28 2014-07-03 华为技术有限公司 Method and system for synchronizing distributed database
CN104021033A (en) * 2014-06-23 2014-09-03 中国银行股份有限公司 Method and system for hashing busy processing nodes
CN104021033B (en) * 2014-06-23 2018-06-08 中国银行股份有限公司 A kind of ashing technique and system of busy processing node
CN105407114A (en) * 2014-08-29 2016-03-16 北京信威通信技术股份有限公司 Client and method for processing Zookeeper cluster data
CN105407114B (en) * 2014-08-29 2019-02-22 北京信威通信技术股份有限公司 Handle the client and method of Zookeeper company-data
CN107431881A (en) * 2015-02-24 2017-12-01 苹果公司 Periphery perceives networking data path back and forth and coexisted
CN107291710A (en) * 2016-03-30 2017-10-24 杭州海康威视数字技术股份有限公司 A kind of method and device updated the data for distributed data base system
CN107291710B (en) * 2016-03-30 2020-07-03 杭州海康威视数字技术股份有限公司 Method and device for updating data for distributed database system
US11176110B2 (en) 2016-03-30 2021-11-16 Hangzhou Hikvision Digital Technology Co., Ltd. Data updating method and device for a distributed database system
CN107453994A (en) * 2016-05-30 2017-12-08 北京信威通信技术股份有限公司 Data transmission method and device based on DHT networks
CN106685688A (en) * 2016-09-26 2017-05-17 深圳市潮流网络技术有限公司 Cluster computer device synchronous upgrade method
CN109165321A (en) * 2018-07-28 2019-01-08 华中科技大学 A kind of consistency Hash table construction method and system based on nonvolatile memory

Also Published As

Publication number Publication date
CN101369923B (en) 2010-12-29

Similar Documents

Publication Publication Date Title
CN101369923B (en) Method for improving cluster web service performance by using distributed hash table
CN101656789B (en) Method for managing application information of mobile phone and application program manager
CN104199666A (en) Dynamic configuration method and device for application program
CN110365750A (en) Service registration system and method
CN105472002B (en) Based on the session synchronization method copied immediately between clustered node
CN101719075B (en) Method for switching theme of Java virtual machine and terminal device
CN107861686A (en) File memory method, service end and computer-readable recording medium
CN101931647B (en) Three-tier architecture based method for optimizing incremental update of system data
CN104580226A (en) Session data sharing system and method
CN102916974A (en) Cluster configuration updating method
CN108829720B (en) Data processing method and device
CN102291416A (en) Two-way synchronizing method and system of client-side and server-side
CN104468148A (en) Nginx server configuration maintenance method and system
CN101359999A (en) Method and apparatus for network element data synchronization
US10224972B2 (en) Systems, methods, and computer-readable media for tracking updates and loading data
CN100403280C (en) Method and apparatus for updating data
CN112162817B (en) Processing method and device for deployment service resources of container cluster and storage medium
CN101115180A (en) Electronic program menu system and functional module dynamic load operating method
CN113127023A (en) Method, device and system for upgrading service
CN110324167B (en) Configuration method, device and system of service governance rules and electronic equipment
CN101751292B (en) Method for realizing consistency function of multimachine core data in ATC (automatic timing corrector) system
CN105610701B (en) A kind of method, apparatus and system of instant messaging
CN107786650A (en) A kind of synchronous method, the apparatus and system of storage medium and management strategy
CN111124536A (en) Data isolation-based dual-system data sharing method and device and terminal equipment
CN110502574A (en) Information synchronization method, user equipment, storage medium and the device of cross-system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant