CN107545053B - Cluster system cache query method and device - Google Patents

Cluster system cache query method and device Download PDF

Info

Publication number
CN107545053B
CN107545053B CN201710734846.1A CN201710734846A CN107545053B CN 107545053 B CN107545053 B CN 107545053B CN 201710734846 A CN201710734846 A CN 201710734846A CN 107545053 B CN107545053 B CN 107545053B
Authority
CN
China
Prior art keywords
interface
time
response time
average response
timing task
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
CN201710734846.1A
Other languages
Chinese (zh)
Other versions
CN107545053A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201710734846.1A priority Critical patent/CN107545053B/en
Publication of CN107545053A publication Critical patent/CN107545053A/en
Application granted granted Critical
Publication of CN107545053B publication Critical patent/CN107545053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a cluster system cache query method and device, comprising the following steps: determining the average response time of each interface in the timing task; if the average response time of the interface is larger than the set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time; and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query. By using the cache query method provided by the application, the waiting time of a user can be further reduced, the user experience is improved, the problem that the interface in the traditional cache scheme is overtime, so that the underlying command is blocked and waits endlessly can be fundamentally avoided, the stability and reliability of the distributed cluster system are improved, and the competitiveness of a storage product is improved.

Description

Cluster system cache query method and device
Technical Field
The invention relates to the field of distributed storage systems, in particular to a cluster system cache query method and device.
Background
In a distributed storage management system, in order to improve the system performance and reduce the waiting delay of users, the traditional effective solution is to add a cache technology, put a time-consuming request into a server timing task, request data from a bottom command line at regular time, and persist the data, when the foreground requests, return the persisted data to the foreground, instead of directly requesting the command line.
Although the cache mode can greatly reduce the waiting time of users, the problem that the bottom layer command of the timing task request is overtime is not solved, namely, part of interfaces in the bottom layer command interface of the timing task request consumes long time and system resources. And the server side has no perception mechanism and always sends the bottom layer command according to the set request frequency, so that the progress of the bottom layer command is blocked quickly and any request cannot be responded.
Therefore, how to solve the problem of process jamming due to the failure of the underlying command response is an urgent technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method and an apparatus for querying a cluster system cache, which can avoid the problem that a bottom-layer command is blocked due to being unable to respond. The specific scheme is as follows:
a cluster system cache query method comprises the following steps:
determining the average response time of each interface in the timing task;
if the average response time of the interface is larger than a set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time;
and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query.
Preferably, in the above method for querying a cache of a cluster system provided in the embodiment of the present invention, the following method is used to determine the average response time of each interface in the timing task:
counting the response time of all interfaces in the timing task;
sampling and automatically calculating the average response time of each interface.
Preferably, in the method for querying a cache of a cluster system provided in the embodiment of the present invention, if there is an average response time of an interface greater than a set time threshold, when the timed task polls the interface for the first time, a current request state of the interface is saved, which specifically includes:
if the average response time of the interface is larger than a set time threshold, marking the interface as an easy timeout interface;
when the timing task polls the easy timeout interface for the first time, automatically recording the execution state of the easy timeout interface;
if the first polling is finished, the time-out interface still does not receive the return data of the bottom layer command, and the time-out interface is stored to be in an executing state.
Preferably, in the above method for querying a cache of a cluster system provided in the embodiment of the present invention, while determining an average response time of each interface in a timing task, the method further includes:
automatically setting the timing request frequency of each interface according to the average response time;
and polling each interface according to the timing request frequency.
The embodiment of the present invention further provides a device for querying a cache of a cluster system, including:
the response time determining module is used for determining the average response time of each interface in the timing task;
the request state storage module is used for storing the current request state of the interface when the timing task polls the interface for the first time if the average response time of the interface is larger than a set time threshold;
and the request query canceling module is used for canceling the request query if the interface does not receive the return data of the bottom layer command when the timed task polls the interface for the second time.
Preferably, in the above-mentioned cluster system cache query device provided in the embodiment of the present invention, the response time determining module specifically includes:
the counting unit is used for counting the response time of all interfaces in the timing task;
and the calculating unit is used for sampling and automatically calculating the average response time of each interface.
Preferably, in the above-mentioned cluster system cache query device provided in the embodiment of the present invention, the request state saving module specifically includes:
the marking unit is used for marking the interface as an easy timeout interface if the average response time of the interface is greater than a set time threshold;
the recording unit is used for automatically recording the execution state of the easy timeout interface when the timing task polls the easy timeout interface for the first time;
and the storage unit is used for storing the easy timeout interface as an executing state if the easy timeout interface does not receive the return data of the bottom layer command after the first polling is finished.
Preferably, in the above-mentioned cluster system cache query device provided in the embodiment of the present invention, further includes:
the frequency setting module is used for automatically setting the timing request frequency of each interface according to the average response time; and polling each interface according to the timing request frequency.
The invention provides a cluster system cache query method and device, comprising the following steps: determining the average response time of each interface in the timing task; if the average response time of the interface is larger than the set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time; and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query. By using the cache query method provided by the invention, the waiting time of a user can be further reduced, the user experience is improved, the problem that the bottom layer command is blocked and waits endlessly due to overtime of an interface in the traditional cache scheme can be fundamentally avoided, the stability and reliability of a distributed cluster system are improved, and the competitiveness of a storage product is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a cluster system cache query method according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a cluster system cache query method, as shown in fig. 1, comprising the following steps:
s101, determining the average response time of each interface in a timing task;
s102, if the average response time of the interface is larger than a set time threshold, when the timing task polls the interface for the first time, the current request state of the interface is saved;
and S103, when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query.
In the above method for querying a cache of a cluster system provided in the embodiment of the present invention, first, an average response time of each interface in a timing task is determined; if the average response time of the interface is larger than the set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time; and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query. By using the cache query method, the user waiting time can be further reduced, the user experience is improved, the problem of endless waiting of bottom-layer command blocking caused by overtime of an interface in the traditional cache scheme can be fundamentally avoided, the stability and reliability of the distributed cluster system are improved, and the competitiveness of a storage product is improved.
Further, in specific implementation, in the above method for querying a cache of a cluster system provided in the embodiment of the present invention, the following method is used to determine an average response time of each interface in a timing task:
firstly, counting the response time of all interfaces in a timing task;
then sampling is carried out, and the average response time of each interface is automatically calculated.
Further, in specific implementation, in the above method for querying a cache of a cluster system provided in the embodiment of the present invention, if the average response time of an interface is greater than the set time threshold in step S102, when the timed task polls the interface for the first time, the current request state of the interface is saved, which may specifically include the following steps:
firstly, if the average response time of an interface is larger than a set time threshold, marking the interface as an easy timeout interface;
then, when the timing task polls the easy overtime interface for the first time, automatically recording the execution state of the easy overtime interface;
if the first polling is finished, the easy timeout interface still does not receive the return data of the bottom layer command, and the easy timeout interface is stored to be in an executing state.
Therefore, the interface query state with long time consumption is recorded, the interfaces with long time consumption (namely the interfaces easy to timeout) are polled each time, the last query state is judged, if no result is returned, the polling is ended, the problem that a server still sends a query request under the condition that a bottom-layer command cannot return data is solved, the command progress is accelerated to enter a stuck state, and the stability of a product is improved.
In specific implementation, in the above method for querying a cache of a cluster system provided in the embodiment of the present invention, while determining an average response time of each interface in a timing task, the method may further include the following steps:
automatically setting the timing request frequency of each interface according to the average response time;
each interface is polled according to the timing request frequency.
Therefore, the average response time of the interfaces is automatically calculated, the timing request frequency of each interface is intelligently formulated, and the user experience is greatly improved.
Based on the same inventive concept, embodiments of the present invention further provide a cluster system cache query device, and since the principle of the device for solving the problem is similar to the foregoing cluster system cache query method, the implementation of the device may refer to the implementation of the cluster system cache query method, and repeated details are not repeated.
In specific implementation, the apparatus for querying a cache of a cluster system according to an embodiment of the present invention specifically includes:
the response time determining module is used for determining the average response time of each interface in the timing task;
the request state storage module is used for storing the current request state of the interface when the timing task polls the interface for the first time if the average response time of the interface is larger than a set time threshold;
and the request query canceling module is used for canceling the request query if the interface does not receive the return data of the bottom layer command when the timed task polls the interface for the second time.
In the above-mentioned cluster system cache query device provided in the embodiment of the present invention, the last query state may be determined by automatically calculating the average time of interface responses and storing the interface query states recording the time-consuming periods, and polling the time-consuming interfaces each time, and if no result is returned, ending the polling, thereby fundamentally avoiding the problem of endless waiting for the bottom-layer command to be blocked due to the timeout of the interface in the conventional cache scheme, improving the stability and reliability of the distributed cluster system, and improving the competitiveness of the stored product.
Further, in a specific implementation, in the above-mentioned cache query device of a cluster system provided in the embodiment of the present invention, the response time determining module may specifically include:
the counting unit is used for counting the response time of all interfaces in the timing task;
and the calculating unit is used for sampling and automatically calculating the average response time of each interface.
Further, in a specific implementation, in the above-mentioned cluster system cache query device provided in the embodiment of the present invention, the request state saving module may specifically include:
the marking unit is used for marking the interface as an easy timeout interface if the average response time of the interface is greater than a set time threshold;
the recording unit is used for automatically recording the execution state of the easy timeout interface when the timing task polls the easy timeout interface for the first time;
and the storage unit is used for storing the easy timeout interface as an executing state if the easy timeout interface does not receive the return data of the bottom layer command after the first polling is finished.
In addition, in a specific implementation, in the above-mentioned cluster system cache query device provided in the embodiment of the present invention, the method may further include:
the frequency setting module is used for automatically setting the timing request frequency of each interface according to the average response time; each interface is polled according to the timing request frequency.
The embodiment of the invention provides a method and a device for querying a cluster system cache, which comprise the following steps: determining the average response time of each interface in the timing task; if the average response time of the interface is larger than the set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time; and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query. By using the cache query method provided by the invention, the waiting time of a user can be further reduced, the user experience is improved, the problem that the bottom layer command is blocked and waits endlessly due to overtime of an interface in the traditional cache scheme can be fundamentally avoided, the stability and reliability of a distributed cluster system are improved, and the competitiveness of a storage product is improved.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for the cluster system cache query method and device, and a specific example is applied in this document to explain the principle and implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (4)

1. A cluster system cache query method is characterized by comprising the following steps:
counting the response time of all interfaces in the timing task;
sampling, and automatically calculating the average response time of each interface to determine the average response time of each interface in the timing task;
automatically setting the timing request frequency of each interface according to the average response time;
polling each interface according to the timing request frequency;
if the average response time of the interface is larger than a set time threshold, the current request state of the interface is saved when the timing task polls the interface for the first time;
and when the timing task polls the interface for the second time, if the interface does not receive the return data of the bottom layer command, canceling the request query.
2. The method according to claim 1, wherein if there is an average response time of an interface greater than a set time threshold, the current request state of the interface is saved when the timed task polls the interface for the first time, specifically including:
if the average response time of the interface is larger than a set time threshold, marking the interface as an easy timeout interface;
when the timing task polls the easy timeout interface for the first time, automatically recording the execution state of the easy timeout interface;
if the first polling is finished, the time-out interface still does not receive the return data of the bottom layer command, and the time-out interface is stored to be in an executing state.
3. A cluster system cache lookup apparatus, comprising:
the response time determining module is used for determining the average response time of each interface in the timing task; the response time determination module specifically includes: the counting unit is used for counting the response time of all interfaces in the timing task; the calculating unit is used for sampling and automatically calculating the average response time of each interface;
the frequency setting module is used for automatically setting the timing request frequency of each interface according to the average response time; polling each interface according to the timing request frequency;
the request state storage module is used for storing the current request state of the interface when the timing task polls the interface for the first time if the average response time of the interface is larger than a set time threshold;
and the request query canceling module is used for canceling the request query if the interface does not receive the return data of the bottom layer command when the timed task polls the interface for the second time.
4. The device according to claim 3, wherein the request state saving module specifically includes:
the marking unit is used for marking the interface as an easy timeout interface if the average response time of the interface is greater than a set time threshold;
the recording unit is used for automatically recording the execution state of the easy timeout interface when the timing task polls the easy timeout interface for the first time;
and the storage unit is used for storing the easy timeout interface as an executing state if the easy timeout interface does not receive the return data of the bottom layer command after the first polling is finished.
CN201710734846.1A 2017-08-24 2017-08-24 Cluster system cache query method and device Active CN107545053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710734846.1A CN107545053B (en) 2017-08-24 2017-08-24 Cluster system cache query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710734846.1A CN107545053B (en) 2017-08-24 2017-08-24 Cluster system cache query method and device

Publications (2)

Publication Number Publication Date
CN107545053A CN107545053A (en) 2018-01-05
CN107545053B true CN107545053B (en) 2021-01-22

Family

ID=60958850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710734846.1A Active CN107545053B (en) 2017-08-24 2017-08-24 Cluster system cache query method and device

Country Status (1)

Country Link
CN (1) CN107545053B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110769017A (en) * 2018-07-27 2020-02-07 北京国双科技有限公司 Data request processing method and device, storage medium and processor
CN111552579A (en) * 2020-03-02 2020-08-18 成都新潮传媒集团有限公司 Method and device for remotely scheduling Jenkins
CN111858086B (en) * 2020-06-15 2023-07-21 福建天泉教育科技有限公司 Processing method and storage medium for queue timeout in request task processing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862576A (en) * 2005-08-19 2006-11-15 华为技术有限公司 Method for obtaining timing task carrying-out time
CN101562543A (en) * 2009-05-25 2009-10-21 阿里巴巴集团控股有限公司 Cache data processing method and processing system and device thereof
CN101859260A (en) * 2010-05-14 2010-10-13 中国科学院计算技术研究所 Timer management device and management method for operating system
CN101901164A (en) * 2009-05-27 2010-12-01 北京金山软件有限公司 Time plan scheduler module and method
CN103812709A (en) * 2014-02-28 2014-05-21 上海斐讯数据通信技术有限公司 Light ray road administration end system and data statistics method thereof
CN105630585A (en) * 2015-12-21 2016-06-01 北京奇虎科技有限公司 Periodic task processing method and apparatus
CN106844214A (en) * 2017-01-23 2017-06-13 北京思特奇信息技术股份有限公司 A kind of automatic method and device that sectional drawing is carried out to page rendering

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862576A (en) * 2005-08-19 2006-11-15 华为技术有限公司 Method for obtaining timing task carrying-out time
CN101562543A (en) * 2009-05-25 2009-10-21 阿里巴巴集团控股有限公司 Cache data processing method and processing system and device thereof
EP2435916A1 (en) * 2009-05-25 2012-04-04 Alibaba Group Holding Limited Cache data processing using cache cluster with configurable modes
CN101901164A (en) * 2009-05-27 2010-12-01 北京金山软件有限公司 Time plan scheduler module and method
CN101859260A (en) * 2010-05-14 2010-10-13 中国科学院计算技术研究所 Timer management device and management method for operating system
CN103812709A (en) * 2014-02-28 2014-05-21 上海斐讯数据通信技术有限公司 Light ray road administration end system and data statistics method thereof
CN105630585A (en) * 2015-12-21 2016-06-01 北京奇虎科技有限公司 Periodic task processing method and apparatus
CN106844214A (en) * 2017-01-23 2017-06-13 北京思特奇信息技术股份有限公司 A kind of automatic method and device that sectional drawing is carried out to page rendering

Also Published As

Publication number Publication date
CN107545053A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
US10740136B2 (en) Automatic virtual machine termination in a cloud
CN107545053B (en) Cluster system cache query method and device
WO2019205371A1 (en) Server, message allocation method, and storage medium
CN106230997B (en) Resource scheduling method and device
US9477618B2 (en) Information processing device, information processing system, storage medium storing program for controlling information processing device, and method for controlling information processing device
WO2021093365A1 (en) Gpu video memory management control method and related device
US20120072575A1 (en) Methods and computer program products for aggregating network application performance metrics by process pool
US10986191B2 (en) Method and device for scheduling resources
EP3054387A1 (en) Data compression method and storage system
CN111562889B (en) Data processing method, device, system and storage medium
CN107343023A (en) Resource allocation methods, device and electronic equipment in a kind of Mesos management cluster
CN110647392A (en) Intelligent elastic expansion method based on container cluster
CN110620681A (en) Network connection timeout time setting method, device, equipment and medium
CN106126335A (en) The Media Survey method of terminal unit and terminal unit
CN109889406B (en) Method, apparatus, device and storage medium for managing network connection
CN112817772B (en) Data communication method, device, equipment and storage medium
CN109669636B (en) Distributed intelligent storage system
CN110865877A (en) Task request response method and device
CN109426563B (en) Process management method and device
CN107229424B (en) Data writing method for distributed storage system and distributed storage system
WO2022021858A1 (en) Method and system for achieving high service availability in high-load scene in distributed system
CN115269243A (en) Method, device and equipment for detecting process and storage medium
CN110399216B (en) Method, system and device for distributing power consumption of whole machine box and readable storage medium
WO2020220534A1 (en) Middleware-based data processing method and related apparatus
WO2020206703A1 (en) Terminal control method and apparatus, storage medium, and electronic device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201202

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant