JP2010198258A - Cache maintenance device, method and program thereof - Google Patents

Cache maintenance device, method and program thereof Download PDF

Info

Publication number
JP2010198258A
JP2010198258A JP2009041612A JP2009041612A JP2010198258A JP 2010198258 A JP2010198258 A JP 2010198258A JP 2009041612 A JP2009041612 A JP 2009041612A JP 2009041612 A JP2009041612 A JP 2009041612A JP 2010198258 A JP2010198258 A JP 2010198258A
Authority
JP
Japan
Prior art keywords
maintenance
cache
condition
allowable delay
count
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009041612A
Other languages
Japanese (ja)
Inventor
Keita Mikami
啓太 三上
Makoto Onizuka
真 鬼塚
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2009041612A priority Critical patent/JP2010198258A/en
Publication of JP2010198258A publication Critical patent/JP2010198258A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a cache maintenance technology for suppressing increase in processing loads without deteriorating a reference speed even in an environment where update processing is highly frequently performed on a database. <P>SOLUTION: A cache maintenance device 1 includes: an update information storage part 11 for storing cache entry update information; a maintenance condition storage part 21 for storing maintenance conditions; a maintenance condition generation part 31 for generating maintenance conditions and writing them into a maintenance condition storage part 21; a maintenance object selection par 41 for selecting a cache entry 1CE becoming the object of maintenance; a maintenance determination part 51 for determining whether or not maintenance conditions are satisfied; and a cache maintenance part 61 for performing the maintenance of the cache entry 1CE. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、1以上のコンピュータのメモリで構成されるキャッシュにデータベースからのデータを保存する分散メモリキャッシュにおける、キャッシュエントリをメンテナンスするキャッシュメンテナンス技術に関する。   The present invention relates to a cache maintenance technique for maintaining cache entries in a distributed memory cache that stores data from a database in a cache constituted by one or more computer memories.

今日、インターネットの爆発的な普及に伴い、多くのサービスがインターネットを通じて提供されている。インターネットを通じて提供されるサービスとしては、例えば、オンラインショッピング、オンラインバンキング、ソーシャルネットワーキングサービス(SNS)があげられる。これらのサービスを提供するシステムは、殆どの場合、ユーザのアカウント情報や商品情報、ユーザによる投稿記事等のデータを保管するデータベース(DB)と、アプリケーションとで構成される。このアプリケーションは、サービスに合わせてデータベースに問い合わせ(クエリ)を発行し、データベースから返却されるデータを用いて、ユーザに提示する結果を作成する。   Today, with the explosion of the Internet, many services are provided through the Internet. Examples of services provided through the Internet include online shopping, online banking, and social networking service (SNS). In most cases, a system that provides these services includes a database (DB) that stores data such as user account information, product information, and posted articles by the user, and an application. This application issues a query to the database in accordance with the service, and creates a result to be presented to the user by using data returned from the database.

これらのシステムでは、ユーザの増加等の原因によりデータベースヘのアクセス数が大きく増加した場合、データベースの帯域幅やCPU資源を使い果たし、パフォーマンスの低下やサーバダウンが発生することがある。また、これらのシステムでは、アクセス数が増加しない場合でも、データベースへの問い合わせが複雑な場合、問い合わせの結果を返却するのに長い時間がかかってしまう。   In these systems, when the number of accesses to the database greatly increases due to an increase in the number of users, the database bandwidth and CPU resources may be exhausted, resulting in performance degradation and server down. In these systems, even if the number of accesses does not increase, if the query to the database is complicated, it takes a long time to return the query result.

そこで、上記のデータベースの処理負荷や参照性能の問題を解決する手法として、データベースとは別に、高速なアクセスが可能な記憶領域(キャッシュ)にこのデータベースヘの問い合わせ結果を利用して作られたデータを格納することが行われている。このキャッシュを利用するシステムは、例えば、データベースには永続性とクエリの処理とに優れたリレーショナルデータベースシステム(RDBMS)、及び、キャッシュには応答性とスケーラビリティとに優れた分散メモリキャッシュで構成できる。   Therefore, as a technique to solve the above-mentioned database processing load and reference performance problems, data created by using this database query result in a storage area (cache) that can be accessed at high speed separately from the database. Is being stored. A system using this cache can be composed of, for example, a relational database system (RDBMS) excellent in persistence and query processing for a database, and a distributed memory cache excellent in responsiveness and scalability.

ここで、キャッシュからデータを取得する場合、アプリケーションは、必要なデータがキャッシュ上に存在するか否かを確認する。キャッシュ上に当該データが存在しなかった場合、データベースからデータを取得するのと同時に、キャッシュにユーザからのリクエストを関連付けたデータを格納する。以降、同一のデータが必要になった場合、アプリケーションは、キャッシュからこのデータを読み出して利用する。これによって、データベースにアクセスする必要がなくなるため、キャッシュを用いたシステムでは、高速にデータを参照可能とする他、データベースヘのアクセス数を低減してデータベースの負荷を軽減することができる。   Here, when acquiring data from the cache, the application checks whether the necessary data exists on the cache. If the data does not exist in the cache, the data associated with the request from the user is stored in the cache at the same time as obtaining the data from the database. Thereafter, when the same data is required, the application reads this data from the cache and uses it. This eliminates the need to access the database, so that a system using a cache can make it possible to refer to data at high speed and reduce the number of accesses to the database to reduce the load on the database.

一方、キャッシュを利用する場合、データベースに更新処理(登録、更新、削除)が発生すると,キャッシュに保存されたデータとデータベースに格納されたデータとに不整合が発生する可能性がある。例えば、データベースで更新されたデータをキャッシュで参照する場合、キャッシュに保存されたデータは更新されていないため、アプリケーションは、更新前の古いデータを参照してしまう。   On the other hand, when the cache is used, if update processing (registration, update, deletion) occurs in the database, there is a possibility that inconsistency occurs between the data stored in the cache and the data stored in the database. For example, when referring to data updated in the database in the cache, the data stored in the cache is not updated, and thus the application refers to old data before update.

従来から、この問題を解決するために、データベースに対して更新が行われた際、キャッシュの一貫性(cache consistency)を保つためのキャッシュメンテナンス技術が提案されている。   Conventionally, in order to solve this problem, a cache maintenance technique for maintaining cache consistency when a database is updated has been proposed.

この技術としては、キャッシュを無効化(invalidation)するものが提案されている(例えば、非特許文献1参照)。この非特許文献1に記載の無効化方式では、データベースに対してキャッシュに不整合が発生するような更新が行われた場合、データベースがキャッシュに対して無効化メッセージを送信して、キャッシュで不整合が発生するデータを無効化し、キャッシュに保存された更新前のデータが参照されてしまうことを防止する。   As this technique, one that invalidates a cache has been proposed (see, for example, Non-Patent Document 1). In the invalidation method described in Non-Patent Document 1, when an update that causes inconsistency in the cache is performed on the database, the database transmits an invalidation message to the cache, and the cache is not valid. Data in which matching occurs is invalidated, and data before update stored in the cache is prevented from being referred to.

また、この無効化後に、データベースに再度問い合わせを行うことでキャッシュに保存された全データを入れ替えて最新に保つ、再問い合わせ方式も提案されている(例えば、非特許文献2及び非特許文献5参照)。   In addition, a re-query method has also been proposed in which all data stored in the cache is replaced and kept up-to-date by making a query to the database again after the invalidation (see, for example, Non-Patent Document 2 and Non-Patent Document 5). ).

また、キャッシュに保存されたデータが再利用可能であるような環境において、再問い合わせ方式によってキャッシュに保存された全データを入れ替えるのではなく、更新された差分のみを計算してこの差分をキャッシュに反映し、既にキャッシュに保存されているデータを生して最新に保つ、差分更新方式も提案されている(例えば、非特許文献3及び非特許文献4参照)。   Also, in an environment where the data stored in the cache is reusable, instead of replacing all the data stored in the cache by the re-query method, only the updated difference is calculated and this difference is stored in the cache. There has also been proposed a differential update method that reflects and maintains data that is already stored in the cache (see, for example, Non-Patent Document 3 and Non-Patent Document 4).

<従来のキャッシュメンテナンス技術:第1例>
ここで、図24を参照し、従来のキャッシュメンテナンス技術の第1例を説明する。図24に示すように、キャッシュメンテナンスシステム900は、キャッシュメンテナンス装置9Aと、データベース9Bと、キャッシュ9Cとを備える。ここで、キャッシュメンテナンスシステム900は、インターネット等のネットワークNを介して、キャッシュメンテナンス装置9Aと、データベース9Bと、キャッシュ9Cとを接続している。
<Conventional cache maintenance technology: first example>
Here, a first example of the conventional cache maintenance technique will be described with reference to FIG. As shown in FIG. 24, the cache maintenance system 900 includes a cache maintenance device 9A, a database 9B, and a cache 9C. Here, the cache maintenance system 900 connects the cache maintenance device 9A, the database 9B, and the cache 9C via a network N such as the Internet.

キャッシュメンテナンス装置9Aは、キャッシュ9Cに保存されたデータに不整合が発生した場合、無効化方式又は再問い合わせ方式によって、キャッシュ9Cのメンテナンスを行うものである。このキャッシュメンテナンス装置9Aは、メンテナンス対象選択部91と、キャッシュメンテナンス部92とを備える。   The cache maintenance device 9A performs maintenance of the cache 9C by the invalidation method or the re-inquiry method when inconsistency occurs in the data stored in the cache 9C. The cache maintenance device 9A includes a maintenance target selection unit 91 and a cache maintenance unit 92.

データベース9Bは、キャッシュ9Cの対象となるデータを格納するリレーショナルデータベース等の一般的なデータベースである。このデータベース9Bは、アプリケーションの種類に応じて、様々なデータを格納する。   The database 9B is a general database such as a relational database that stores data to be cached 9C. The database 9B stores various data according to the type of application.

キャッシュ9Cは、1以上のコンピュータのメモリで構成された分散メモリキャッシュである。なお、キャッシュ9Cを構成する各コンピュータの図示は、省略した。   The cache 9C is a distributed memory cache composed of one or more computer memories. Note that illustration of each computer constituting the cache 9C is omitted.

以下、キャッシュ9Cのメンテナンスについて詳細に説明する。メンテナンス対象選択部91は、データベース9Bに対して更新処理が行われた際、その更新の内容に基づいて、データベースの更新処理の影響を受けメンテナンスが必要となる、キャッシュ9Cのキャッシュエントリ(不図示)を選択するものである。ここで、メンテナンス対象選択部91は、例えば、データベース9Bに対する更新問い合わせの一部又は全部を元に、メンテナンス対象を検索可能とするマッピングテーブルを用意する方法を用いる。また、メンテナンス対象選択部91は、例えば、データベース9Bに対する更新問い合わせの一部又は全部を入力として、メンテナンス対象を検索するため問い合わせ文を予め用意する方法を用いる。さらに、メンテナンス対象選択部91は、更新処理のあったテーブルを元に作られたキャッシュエントリを全てメンテナンス対象とする方法を用いても良く、前記した非特許文献3に記載の技術を用いても良い。   Hereinafter, the maintenance of the cache 9C will be described in detail. When the update process is performed on the database 9B, the maintenance target selection unit 91 is affected by the update process of the database and requires maintenance based on the contents of the update. ) Is selected. Here, the maintenance target selection unit 91 uses, for example, a method of preparing a mapping table that makes it possible to search for a maintenance target based on a part or all of an update inquiry to the database 9B. In addition, the maintenance target selection unit 91 uses, for example, a method of preparing an inquiry sentence in advance for searching for a maintenance target by inputting a part or all of an update inquiry to the database 9B. Furthermore, the maintenance target selection unit 91 may use a method in which all cache entries created based on a table that has undergone update processing are subject to maintenance, or may use the technique described in Non-Patent Document 3 described above. good.

キャッシュメンテナンス部92は、メンテナンス対象選択部91が選択したメンテナンス対象のキャッシュエントリを無効化するための無効化メッセージを送信するものである。また、キャッシュメンテナンス部92は、再問い合わせ方式を採用する場合、無効化メッセージの送信後、データベース9Bに対して、このキャッシュエントリのデータを取得するための問い合わせを発行し、その問い合わせ結果をキャッシュ2Cに格納する。このようにして、キャッシュメンテナンスシステム900は、キャッシュのメンテナンスを行う。なお、無効化方式及び再問い合わせ方式の詳細については、前記した非特許文献1,2,3,5に記載されている。   The cache maintenance unit 92 transmits an invalidation message for invalidating the maintenance target cache entry selected by the maintenance target selection unit 91. Further, when the re-inquiry method is adopted, the cache maintenance unit 92 issues an inquiry for acquiring the data of the cache entry to the database 9B after transmitting the invalidation message, and the inquiry result is transmitted to the cache 2C. To store. In this way, the cache maintenance system 900 performs cache maintenance. The details of the invalidation method and the re-inquiry method are described in Non-Patent Documents 1, 2, 3, and 5 described above.

<従来のキャッシュメンテナンス技術:第2例>
さらに、図25を参照し、従来のキャッシュメンテナンス技術の第2例を説明する(適宜図24参照)。図25においては、キャッシュメンテナンス装置9Aは、キャッシュ9Cに保存されたデータに不整合が発生した場合、差分更新方式によって、キャッシュ9Cのメンテナンスを行う。
<Conventional cache maintenance technology: second example>
Further, a second example of the conventional cache maintenance technique will be described with reference to FIG. 25 (see FIG. 24 as appropriate). In FIG. 25, the cache maintenance device 9A performs maintenance of the cache 9C by the differential update method when inconsistency occurs in the data stored in the cache 9C.

図25に示すように、データベース9Bは、「message」というテーブル9T1と「follower」というテーブル9T2とを格納する。また、キャッシュ9Cは、テーブル9T1とテーブル9T2とを結合(JOIN)した結果である「timeline」というキャッシュエントリ9CEを保存する。   As illustrated in FIG. 25, the database 9B stores a table 9T1 called “message” and a table 9T2 called “follower”. Further, the cache 9C stores a cache entry 9CE “timeline” that is a result of joining (JOIN) the table 9T1 and the table 9T2.

ここで、テーブル9T1に新たなレコード(図25におけるid=6)が登録(INSERT)された場合、このレコードに基づいて、差分データを求めるための問い合わせ9Qを行う。その結果、求められた差分データ9Dを、keyに基づいて、キャッシュエントリ9CEを更新する。このように、従来の差分更新方式では、データベース9Bに対して更新処理が発生する都度、このキャッシュ更新処理を行う必要がある。   Here, when a new record (id = 6 in FIG. 25) is registered (INSERT) in the table 9T1, an inquiry 9Q for obtaining difference data is performed based on this record. As a result, the cache entry 9CE is updated based on the obtained difference data 9D based on the key. Thus, in the conventional differential update method, it is necessary to perform this cache update process every time an update process occurs for the database 9B.

Greg Barish,Katia obraczka,“World Wide Web Caching: Trends and techniques",IEEE Communications Magazine 2000.5Greg Barish, Katia obraczka, “World Wide Web Caching: Trends and techniques”, IEEE Communications Magazine 2000.5 James Gwertzman,Margo Seltzer,“World Wide Web Cache Consistency",USENIX technical Conference,1996James Gwertzman, Margo Seltzer, “World Wide Web Cache Consistency”, USENIX technical Conference, 1996 Ashish Gupta,lnderpal Singh Mumick,“Maintenance of Materialized Views:Problems,techniques,and Applications",IEEE Data Engineering Bulletin, 1995Ashish Gupta, lnderpal Singh Mumick, “Maintenance of Materialized Views: Problems, technologies, and Applications”, IEEE Data Engineering Bulletin, 1995 Jingren Zhou,Per・Ake Larson,Hicham G. Elmongui,‘Lazy maintenance of materialized views",VLDB Conference,2007Jingren Zhou, Per Ake Larson, Hicham G. Elmongui, “Lazy maintenance of materialized views”, VLDB Conference, 2007 Cal Henderson,「スケーラブルWebサイト」,オライリー・ジャパン,2006Cal Henderson, “Scalable Web Site”, O'Reilly Japan, 2006

しかし、前記した無効化方式では、データベースに高い頻度で更新処理が発生した場合、キャッシュの無効化が多発するため、キャッシュヒット率が大きく低下してしまい、キャッシュの効果(参照速度の向上及び処理負荷の低減)が十分に得られないという問題がある。   However, in the invalidation method described above, when update processing occurs frequently in the database, cache invalidation occurs frequently, so that the cache hit rate is greatly reduced, and the cache effect (improvement of reference speed and processing) There is a problem that sufficient load reduction cannot be obtained.

また、前記した再問い合わせ方式及び差分更新方式では、データベースに高い頻度で更新処理が発生した場合、キャッシュメンテナンス時に毎回データベースヘの問い合わせが発生するため、データベースヘの問い合わせが多発し、データベースの処理負荷が増大し、パフォーマンスの低下やサーバダウンに繋がる。   Further, in the above-described re-query method and differential update method, if update processing occurs frequently in the database, the database is inquired every time during cache maintenance. Increase, leading to performance degradation and server down.

そこで、本発明は、データベースに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えるキャッシュメンテナンス技術を提供することを目的とする。   Accordingly, an object of the present invention is to provide a cache maintenance technique that minimizes an increase in processing load without reducing the reference speed even in an environment where update processing is performed on a database with high frequency.

前記した課題を解決するため、本願第1発明に係るキャッシュメンテナンス装置は、1以上のコンピュータのメモリで構成されるキャッシュにデータベースからのデータを保存する分散メモリキャッシュにおける、前記データを前記キャッシュに保存する単位となるキャッシュエントリをメンテナンスするキャッシュメンテナンス装置において、前記キャッシュエントリをメンテナンスする条件であるメンテナンス条件を記憶するメンテナンス条件記憶部と、前記メンテナンス条件記憶部に記憶したメンテナンス条件を参照し、前記メンテナンス条件を満たすときにメンテナンス可能と判定するメンテナンス判定部と、前記メンテナンス判定部がメンテナンス可能と判定した場合、前記キャッシュエントリをメンテナンスするキャッシュメンテナンス部と、を備えることを特徴とする。   In order to solve the above-described problem, a cache maintenance apparatus according to the first invention of the present application stores the data in the cache in a distributed memory cache that stores data from a database in a cache constituted by one or more computer memories. In a cache maintenance device that maintains a cache entry as a unit to perform maintenance, a maintenance condition storage unit that stores a maintenance condition that is a condition for maintaining the cache entry, a maintenance condition stored in the maintenance condition storage unit, and the maintenance A maintenance determination unit that determines that maintenance is possible when a condition is satisfied, and a cache member that maintains the cache entry when the maintenance determination unit determines that maintenance is possible. Characterized in that it comprises a nonce portion.

かかる構成によれば、キャッシュメンテナンス装置は、データベースの更新処理によってキャッシュエントリとデータベースのデータとの間に不整合が発生したとき、常にキャッシュエントリのメンテナンスを行うのではなく、所定のメンテナンス条件を満たす場合にのみ、キャッシュエントリのメンテナンスを行うこととした。これによって、キャッシュメンテナンス装置は、データベースに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。   According to such a configuration, when a mismatch occurs between the cache entry and the data in the database due to the database update process, the cache maintenance device does not always maintain the cache entry but satisfies a predetermined maintenance condition. Only in this case, it was decided to maintain the cache entry. As a result, the cache maintenance device can minimize the increase in processing load without reducing the reference speed even in an environment where update processing is frequently performed on the database.

なお、分散メモリキャッシュとは、1以上のコンピュータのメモリを連携して巨大な論理メモリ(キャッシュ)として扱う技術であり、keyとvalueとのペアによる単純なアクセスのみを提供する代わりに、ハッシュ分散による高いスケーラビリティを有することを特徴とする。   Note that the distributed memory cache is a technique that handles the memory of one or more computers in cooperation with each other as a huge logical memory (cache). Instead of providing only simple access using a pair of key and value, hash distribution is used. It is characterized by having high scalability.

なお、キャッシュエントリとは、データベースからのデータをキャッシュに保存する単位となるものであり、例えば、keyと対応付けてデータベースへの問い合わせ結果をキャッシュに保存したものである。   The cache entry is a unit for storing data from the database in the cache. For example, a cache entry is stored in the cache in association with the key.

なお、メンテナンスとは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間に不整合が発生した際、無効化方式、再問い合わせ方式又は差分更新方式を用いてこのキャッシュエントリを無効化又はこのデータを整合した状態にすることである。   Note that maintenance means that when an inconsistency occurs between the data and the cache entry corresponding to this data due to database update processing, this cache entry is invalidated, re-inquired, or differentially updated. Or invalidate this data.

なお、無効化方式とは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間に不整合が発生した際、そのキャッシュエントリを無効化し、不整合なデータがキャッシュエントリから読み出されるのを防ぐ方式である。   The invalidation method is to invalidate the cache entry when inconsistency occurs between this data and the cache entry corresponding to this data by updating the database, and the inconsistent data is transferred from the cache entry. This method prevents reading.

なお、再問い合わせ方式とは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間に不整合が発生した際、そのキャッシュエントリに対応する問い合わせをデータベースに対して行い,その問い合わせ結果をキャッシュエントリに上書きすことで、キャッシュエントリとデータとを整合した状態にする方式である。   The re-inquiry method is to perform an inquiry corresponding to the cache entry to the database when inconsistency occurs between this data and the cache entry corresponding to the data due to the database update process. In this method, the cache entry is overwritten with the cache result so that the cache entry and the data are in a consistent state.

また、本願第2発明に係るキャッシュメンテナンス装置は、前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、をさらに備え、前記メンテナンス条件生成部は、前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成することを特徴とする。   Further, the cache maintenance device according to the second aspect of the present invention stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time. A storage unit, and a maintenance condition generation unit that receives at least one of a preset allowable delay number and an allowable delay time, generates the maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit; The maintenance condition generation unit generates the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count when only the allowable delay count is input, and includes only the allowable delay time. Is entered, it shows the time from the previous maintenance time to the current time. When the maintenance condition that enables the maintenance is generated when time exceeds the allowable delay time, and the allowable delay count and the allowable delay time are input, the update count exceeds the allowable delay count The maintenance condition that enables the maintenance is generated when the time or the elapsed time exceeds the allowable delay time.

かかる構成によれば、キャッシュメンテナンス装置は、メンテナンス条件を満たす場合にのみキャッシュエントリのメンテナンスを行い、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置は、無効化方式を採用したときは、メンテナンスによってキャッシュエントリが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。また、キャッシュメンテナンス装置は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。   According to such a configuration, the cache maintenance device performs the maintenance of the cache entry only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the cache maintenance apparatus adopts the invalidation method, the frequency at which the cache entry is invalidated by maintenance is reduced, so that the cache hit rate is greatly improved. Further, when the re-inquiry method is adopted, the cache maintenance device can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance.

なお、更新回数(メンテナンスカウント)とは、キャッシュエントリ毎に、前回のメンテナンス時刻以後にデータが更新された回数を示すものである。   The number of updates (maintenance count) indicates the number of times data has been updated since the previous maintenance time for each cache entry.

なお、許容遅延回数とは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間で、許容遅延回数で指定した回数の不整合が発生したときに、1回のメンテナンスを行うことを示す数値である。   Note that the allowable number of delays means that maintenance is performed once when the number of inconsistencies specified by the allowable number of delays occurs between this data and the cache entry corresponding to this data due to the database update process. A numerical value indicating what to do.

なお、許容遅延時間とは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間に不整合が発生した際、前回のメンテナンス時刻から許容遅延時間以上経過したキャッシュエントリをメンテナンスすることを示す時間である。   The allowable delay time refers to the maintenance of cache entries that have exceeded the allowable delay time from the previous maintenance time when a mismatch occurs between this data and the cache entry corresponding to this data due to the database update process. It is time to show that.

なお、メンテナンスコストとは、データベースサーバにおいて、メンテナンスに伴って費やされるCPU時間等の演算処理量である。   Note that the maintenance cost is an arithmetic processing amount such as CPU time spent for maintenance in the database server.

また、本願第3発明に係るキャッシュメンテナンス装置は、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部、をさらに備え、前記メンテナンス条件生成部は、前記許容遅延回数のみが入力された場合、更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延時間のみが入力された場合、経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記メンテナンス判定部は、前記データベースのテーブルにおける差分データを格納した差分テーブルを参照し、当該差分テーブルのデータ件数を前記更新回数として算出すると共に、当該差分テーブルにおける最も古いデータを格納した時刻から現在時刻までを前記経過時間として算出し、算出した前記更新回数と前記経過時間とを用いて前記メンテナンス条件を満たすか判定し、前記キャッシュメンテナンス部は、前記差分テーブルに格納した前記差分データで前記キャッシュエントリを一括して更新すると共に、更新した前記差分データを前記差分テーブルから削除することを特徴とする。   In the cache maintenance device according to the third aspect of the present invention, at least one of a preset allowable delay count and an allowable delay time is input, and based on the input, the maintenance condition is generated and stored in the maintenance condition storage unit. A maintenance condition generation unit for writing, and when only the allowable delay number is input, the maintenance condition generation unit generates the maintenance condition that enables the maintenance when the number of updates exceeds the allowable delay number When only the allowable delay time is input, the maintenance condition that enables the maintenance when the elapsed time exceeds the allowable delay time is generated, and the allowable delay count and the allowable delay time are input. When the update count exceeds the allowable delay count or the elapsed time The maintenance condition that enables maintenance when a delay time is exceeded is generated, and the maintenance determination unit refers to a difference table that stores difference data in the database table and updates the number of data in the difference table And calculating from the time when the oldest data in the difference table is stored to the current time as the elapsed time, and determining whether the maintenance condition is satisfied using the calculated update count and the elapsed time. The cache maintenance unit collectively updates the cache entry with the difference data stored in the difference table, and deletes the updated difference data from the difference table.

かかる構成によれば、キャッシュメンテナンス装置は、メンテナンス条件を満たす場合にのみ差分データでキャッシュエントリを更新し、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置は、差分更新方式を採用したときは、メンテナンスによって逐次差分データをキャッシュエントリに更新する場合に比べて、問い合わせ処理及び通信処理のオーバーヘッドが大幅に少ないため、メンテナンスコストを大幅に削減できる。   According to such a configuration, the cache maintenance device updates the cache entry with the difference data only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the differential maintenance method is adopted, the cache maintenance device greatly reduces the maintenance cost because the overhead of inquiry processing and communication processing is significantly less than when incremental data is sequentially updated to the cache entry by maintenance. Can be reduced.

なお、差分更新方式とは、データベースの更新処理によって、このデータとこのデータに対応するキャッシュエントリとの間に不整合が発生した際、そのキャッシュエントリを整合した状態に更新するために必要な差分データを算出し,そのキャッシュエントリにこの差分データを反映させることで、キャッシュエントリとデータとを整合した状態にする方式である。   The difference update method is the difference required to update the cache entry to a consistent state when inconsistency occurs between this data and the cache entry corresponding to this data due to the database update process. In this method, the data is calculated and the difference data is reflected in the cache entry so that the cache entry and the data are in a consistent state.

また、本願第4発明に係るキャッシュメンテナンス装置は、前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方と、メンテナンスコストの目標負荷値とが入力され、当該入力に基づいて、前記キャッシュエントリ毎に前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、予め設定された統計期間における前記キャッシュエントリをメンテナンスした回数を示すメンテナンス回数の累積値を統計情報として算出する統計情報算出部と、をさらに備え、前記メンテナンス条件生成部は、前記メンテナンス回数の累積値に前記目標負荷値を乗じて削減目標値を算出し、前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(1)で算出した削減値を前記削減目標値から減算し、前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(2)で算出した削減値を前記削減目標値から減算し、前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(3)で算出した削減値を前記削減目標値から減算し、前記削減目標値から前記削減値を減算した値が0以下になったときは、前記メンテナンス条件の生成を終了することを特徴とする。
A=Mi×(N−1)/N・・・式(1)
A=Mi×(1−T/S)・・・式(2)
A=MIN[{Mi×(N−1)/N},{Mi×(1−T/S)}]・・・式(3)
但し、式(1)〜式(3)において、Aは削減値、Miはメンテナンス回数の累積値、Nは許容遅延回数、Tは許容遅延時間、及び、Sは統計期間である。
Further, the cache maintenance device according to the fourth invention of the present application stores update information that stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time. A storage unit, at least one of a preset allowable delay number and allowable delay time, and a maintenance load target load value are input, and based on the input, the maintenance condition is generated for each cache entry, and the maintenance condition is generated. A maintenance condition generation unit that writes to the maintenance condition storage unit, and a statistical information calculation unit that calculates, as statistical information, a cumulative value of the number of maintenance times indicating the number of times the cache entry is maintained in a preset statistical period, and The maintenance condition generation unit When the reduction target value is calculated by multiplying the cumulative load value by the target load value and only the allowable delay count is input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count And the reduction value calculated by the expression (1) is subtracted from the reduction target value and only the allowable delay time is input, the elapsed time indicating the previous maintenance time to the current time is the allowable delay. The maintenance condition that enables the maintenance when the time is exceeded is generated, the reduction value calculated by Equation (2) is subtracted from the reduction target value, and the allowable delay count and the allowable delay time are input. When the update count exceeds the allowable delay count or when the elapsed time exceeds the allowable delay time, the maintenance condition is enabled. When the value obtained by subtracting the reduction value calculated by Equation (3) from the reduction target value becomes 0 or less, the generation of the maintenance condition is terminated. It is characterized by doing.
A = Mi × (N−1) / N (1)
A = Mi × (1−T / S) (2)
A = MIN [{Mi × (N−1) / N}, {Mi × (1-T / S)}] (3)
In Equations (1) to (3), A is a reduction value, Mi is a cumulative value of the number of maintenance times, N is an allowable delay number, T is an allowable delay time, and S is a statistical period.

かかる構成によれば、キャッシュメンテナンス装置は、メンテナンス条件を満たす場合にのみキャッシュエントリのメンテナンスを行い、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置は、無効化方式を採用したときは、メンテナンスによってキャッシュエントリが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。また、キャッシュメンテナンス装置は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。さらに、キャッシュメンテナンス装置は、目標負荷を達成した後、不要なメンテナンスを行うことがなく、処理負荷をさらに削減できる。   According to such a configuration, the cache maintenance device performs the maintenance of the cache entry only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the cache maintenance apparatus adopts the invalidation method, the frequency at which the cache entry is invalidated by maintenance is reduced, so that the cache hit rate is greatly improved. Further, when the re-inquiry method is adopted, the cache maintenance device can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance. Furthermore, the cache maintenance device can further reduce the processing load without performing unnecessary maintenance after achieving the target load.

なお、目標負荷値とは、メンテナンスコストを削減する目標となる数値である。   The target load value is a numerical value that is a target for reducing the maintenance cost.

また、本願第5発明に係るキャッシュメンテナンス装置は、前記メンテナンス条件生成部が、前記メンテナンス条件を生成しておらず、かつ、前記メンテナンス回数の累積値が最大となる前記キャッシュエントリについて、前記メンテナンス条件を生成することを特徴とする。   Further, in the cache maintenance device according to the fifth invention of the present application, the maintenance condition generation unit does not generate the maintenance condition, and the maintenance condition for the cache entry in which the cumulative value of the number of maintenance times is maximized. Is generated.

かかる構成によれば、キャッシュメンテナンス装置は、メンテナンス回数の累積値が大きい順にキャッシュエントリを選択し、この順にキャッシュエントリのメンテナンスを行うこととした。ここで、メンテナンスの頻度が高いキャッシュエントリ程、メンテナンスの頻度を削減による効果(例えば、無効化方式を採用したときはキャッシュヒット率の向上、再問い合わせ方式を採用したときは処理負荷の削減)が大きくなる。従って、キャッシュメンテナンス装置は、メンテナンス条件を設定してメンテナンスを行うキャッシュエントリの数を必要最小限とし、キャッシュエントリの最新性の低下を最小限に抑える。   According to such a configuration, the cache maintenance device selects cache entries in descending order of the cumulative number of maintenance times, and performs cache entry maintenance in this order. Here, the effect of reducing the maintenance frequency for cache entries with higher maintenance frequency (for example, improving the cache hit rate when the invalidation method is used, and reducing the processing load when the requery method is used). growing. Therefore, the cache maintenance device sets the maintenance conditions and minimizes the number of cache entries to be maintained, thereby minimizing the deterioration in the freshness of the cache entries.

なお、最新性とは、キャッシュエントリから読み出したデータが最新である比率、つまり、不整合が発生しないデータの比率である。また、キャッシュエントリから読み出したデータが最新であるとは、データベースに問い合わせ結果として得られるデータと、キャッシュエントリから読み出したデータとが一致(整合)していることである。   Note that the freshness is a ratio at which data read from a cache entry is the latest, that is, a ratio of data in which inconsistency does not occur. The data read from the cache entry is the latest when the data obtained as a result of the inquiry to the database matches the data read from the cache entry.

また、本願第6発明に係るキャッシュメンテナンス装置は、前記統計情報算出部が、前記統計情報として、前記統計期間における前記キャッシュエントリが参照された参照回数の累積値を算出し、前記メンテナンス条件生成部は、前記メンテナンス条件を生成しておらず、かつ、前記参照回数の累積値が最小となる前記キャッシュエントリについて、前記メンテナンス条件を生成することを特徴とする。   Further, in the cache maintenance device according to the sixth aspect of the present invention, the statistical information calculation unit calculates, as the statistical information, an accumulated value of the number of times the cache entry is referred to in the statistical period, and the maintenance condition generation unit Is characterized in that the maintenance condition is generated for the cache entry in which the maintenance condition is not generated and the cumulative value of the reference count is minimized.

かかる構成によれば、キャッシュメンテナンス装置は、参照回数の累積値が小さい順にキャッシュエントリを選択し、この順にキャッシュエントリのメンテナンスを行うこととした。これによって、キャッシュメンテナンス装置は、メンテナンスによる悪影響が少ないキャッシュエントリから順にメンテナンスを行うことで、キャッシュエントリの最新性の低下を最小限に抑える。   According to such a configuration, the cache maintenance device selects cache entries in ascending order of the cumulative number of reference times, and performs cache entry maintenance in this order. As a result, the cache maintenance device performs maintenance in order from the cache entries that are less adversely affected by the maintenance, thereby minimizing the deterioration in the freshness of the cache entries.

また、本願第7発明に係るキャッシュメンテナンス装置は、前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、前記データベースの負荷を示す負荷値を測定するデータベース負荷測定部と、をさらに備え、前記メンテナンス条件生成部は、前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超え、かつ、前記負荷値が予め設定された負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超え、かつ、前記負荷値が前記負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成し、前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超え又は前記経過時間が前記許容遅延時間を超え、かつ、前記負荷値が前記負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成することを特徴とする。   Further, the cache maintenance device according to the seventh invention of the present application stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time. A storage unit, a maintenance condition generation unit that receives at least one of a preset allowable delay count and an allowable delay time, generates the maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit; and the database A database load measurement unit that measures a load value indicating the load of the maintenance condition generation unit, when only the allowable delay count is input, the update count exceeds the allowable delay count, and The maintenance is possible when the load value satisfies a preset load condition. When the maintenance condition is generated and only the allowable delay time is input, the elapsed time from the previous maintenance time to the current time exceeds the allowable delay time, and the load value satisfies the load condition When the maintenance condition that enables the maintenance is generated and the allowable delay count and the allowable delay time are input, the update count exceeds the allowable delay count or the elapsed time exceeds the allowable delay time. When the load value exceeds the load condition, the maintenance condition that enables the maintenance is generated.

かかる構成によれば、キャッシュメンテナンス装置は、メンテナンス条件を満たす場合にのみキャッシュエントリのメンテナンスを行い、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置は、無効化方式を採用したときは、メンテナンスによってキャッシュエントリが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。また、キャッシュメンテナンス装置は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。さらに、キャッシュメンテナンス装置は、負荷条件を設定することで、データベースの負荷に応じて、メンテナンスの頻度を制御することができる。これによって、キャッシュメンテナンス装置は、例えば、データベースサーバのCPU資源に余裕があるときにメンテナンスの頻度を低下させてCPU資源を節約するといった事態を防止し、データベースにパフォーマンスを十分に発揮させることができる。   According to such a configuration, the cache maintenance device performs the maintenance of the cache entry only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the cache maintenance apparatus adopts the invalidation method, the frequency at which the cache entry is invalidated by maintenance is reduced, so that the cache hit rate is greatly improved. Further, when the re-inquiry method is adopted, the cache maintenance device can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance. Furthermore, the cache maintenance device can control the frequency of maintenance according to the load of the database by setting the load condition. Thus, for example, the cache maintenance device can prevent the situation where the CPU resource is saved by reducing the frequency of maintenance when the CPU resource of the database server is sufficient, and the database can sufficiently exhibit the performance. .

また、本願第8発明に係るキャッシュメンテナンス方法は、1以上のコンピュータのメモリで構成されるキャッシュにデータベースからのデータを保存する分散メモリキャッシュにおける、前記データを前記キャッシュに保存する単位となるキャッシュエントリをメンテナンスするキャッシュメンテナンス方法において、前記キャッシュエントリをメンテナンスする条件であるメンテナンス条件を参照し、前記メンテナンス条件を満たすときにメンテナンス可能と判定するメンテナンス判定ステップと、前記メンテナンス判定ステップでメンテナンス可能と判定した場合、前記キャッシュエントリをメンテナンスするキャッシュメンテナンスステップと、を備えることを特徴とする。   The cache maintenance method according to the eighth aspect of the present invention is a cache entry as a unit for storing the data in the cache in a distributed memory cache that stores data from a database in a cache including one or more computer memories. In the cache maintenance method for maintaining the cache entry, a maintenance determination step that determines that maintenance is possible when the maintenance condition is satisfied is referred to with reference to a maintenance condition that is a condition for maintaining the cache entry, and maintenance is determined in the maintenance determination step A cache maintenance step for maintaining the cache entry.

かかる構成によれば、キャッシュメンテナンス方法は、データベースの更新処理によってキャッシュエントリに保存したデータとデータベースに格納したデータとの間に不整合が発生したとき、常にキャッシュエントリのメンテナンスを行うのではなく、所定のメンテナンス条件を満たす場合にのみ、キャッシュエントリのメンテナンスを行うこととした。これによって、キャッシュメンテナンス方法は、データベースに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。   According to such a configuration, the cache maintenance method does not always maintain the cache entry when inconsistency occurs between the data stored in the cache entry by the database update process and the data stored in the database. Only when a predetermined maintenance condition is satisfied, the cache entry is maintained. As a result, the cache maintenance method can minimize the increase in processing load without reducing the reference speed even in an environment where update processing is frequently performed on the database.

また、本願第9発明に係るキャッシュメンテナンスプログラムは、コンピュータを、本願第1発明から本願第7発明の何れかのキャッシュメンテナンス装置を構成する各手段として機能させることを特徴とする。   A cache maintenance program according to the ninth invention of the present application causes a computer to function as each means constituting the cache maintenance device according to any of the first to seventh inventions of the present application.

かかる構成によれば、キャッシュメンテナンスプログラムは、データベースの更新処理によってキャッシュエントリに保存したデータとデータベースに格納したデータとの間に不整合が発生したとき、常にキャッシュエントリのメンテナンスを行うのではなく、所定のメンテナンス条件を満たす場合にのみ、キャッシュエントリのメンテナンスを行うこととした。これによって、キャッシュメンテナンスプログラムは、データベースに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。   According to such a configuration, the cache maintenance program does not always maintain the cache entry when inconsistency occurs between the data stored in the cache entry by the database update process and the data stored in the database. Only when a predetermined maintenance condition is satisfied, the cache entry is maintained. As a result, the cache maintenance program can minimize the increase in processing load without reducing the reference speed even in an environment where update processing is frequently performed on the database.

本発明によれば、所定のメンテナンス条件を満たす場合にのみ、キャッシュエントリのメンテナンスを行うため、データベースに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。   According to the present invention, the cache entry is maintained only when a predetermined maintenance condition is satisfied. Therefore, even in an environment where update processing is frequently performed on the database, the reference speed does not decrease and the processing load increases. Can be minimized.

本発明の第1実施形態に係るキャッシュメンテナンス装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of a cache maintenance device according to a first embodiment of the present invention. 図1の更新情報記憶部が記憶するキャッシュエントリ更新情報のデータ構造を示す図である。It is a figure which shows the data structure of the cache entry update information which the update information storage part of FIG. 1 memorize | stores. 図1のメンテナンス条件記憶部が記憶するメンテナンス条件のデータ構造を示す図である。It is a figure which shows the data structure of the maintenance conditions which the maintenance condition memory | storage part of FIG. 1 memorize | stores. 図1のキャッシュメンテナンス装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the cache maintenance apparatus of FIG. 図4のステップS2の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S2 of FIG. 図5のステップS23の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S23 of FIG. 本発明の第1実施形態に係るキャッシュメンテナンス装置をコンピュータで実現した例を示す図である。It is a figure showing the example which realized the cash maintenance device concerning a 1st embodiment of the present invention with the computer. 本発明の第2実施形態に係るキャッシュメンテナンス装置の構成を示すブロック図である。It is a block diagram which shows the structure of the cash maintenance apparatus which concerns on 2nd Embodiment of this invention. 図8のキャッシュ差分メンテナンス部によるメンテナンスについて説明する説明図である。It is explanatory drawing explaining the maintenance by the cache difference maintenance part of FIG. 図8のキャッシュメンテナンス装置における、図4のステップS2の詳細を示すフローチャートである。9 is a flowchart showing details of step S2 of FIG. 4 in the cache maintenance device of FIG. 図10のステップS32の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S32 of FIG. 本発明の第3実施形態に係るキャッシュメンテナンス装置の構成を示すブロック図である。It is a block diagram which shows the structure of the cash maintenance apparatus which concerns on 3rd Embodiment of this invention. 図12の更新情報記憶部が記憶するキャッシュエントリ更新情報のデータ構造を示す図である。It is a figure which shows the data structure of the cache entry update information which the update information storage part of FIG. 12 memorize | stores. 図12のメンテナンス条件記憶部が記憶するメンテナンス条件のデータ構造を示す図である。It is a figure which shows the data structure of the maintenance conditions which the maintenance condition memory | storage part of FIG. 12 memorize | stores. 図12のキャッシュメンテナンス装置における、図4のステップS1の詳細を示すフローチャートである。14 is a flowchart showing details of step S1 in FIG. 4 in the cache maintenance device in FIG. 図15のステップS40の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S40 of FIG. 図15のステップS43の第1例を示すフローチャートである。It is a flowchart which shows the 1st example of step S43 of FIG. 図15のステップS43の第2例を示すフローチャートである。It is a flowchart which shows the 2nd example of step S43 of FIG. 本発明の第4実施形態に係るキャッシュメンテナンス装置の構成を示すブロック図である。It is a block diagram which shows the structure of the cache maintenance apparatus which concerns on 4th Embodiment of this invention. 図18のメンテナンス条件記憶部が記憶するメンテナンス条件のデータ構造を示す図である。It is a figure which shows the data structure of the maintenance conditions which the maintenance condition memory | storage part of FIG. 18 memorize | stores. 図18のキャッシュメンテナンス装置における、図4のステップS1の詳細を示すフローチャートである。19 is a flowchart showing details of step S1 in FIG. 4 in the cache maintenance device in FIG. 図18のキャッシュメンテナンス装置における、図5のステップS23の詳細を示すフローチャートである。19 is a flowchart showing details of step S23 in FIG. 5 in the cache maintenance device in FIG. 実施例における許容遅延回数と更新スループットの限界値との関係を示す図である。It is a figure which shows the relationship between the frequency | count of permissible delay and the limit value of update throughput in an Example. 従来のキャッシュメンテナンス技術の第1例を説明する説明図である。It is explanatory drawing explaining the 1st example of the conventional cache maintenance technique. 従来のキャッシュメンテナンス技術の第2例を説明する説明図である。It is explanatory drawing explaining the 2nd example of the conventional cache maintenance technique.

以下、本発明の各実施形態について、適宜図面を参照しながら詳細に説明する。なお、各実施形態において、同一の機能を有する手段及び同一の構成には同一の符号を付し、説明を省略した。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings as appropriate. In each embodiment, means having the same function and the same configuration are denoted by the same reference numerals and description thereof is omitted.

(第1実施形態:無効化方式又は再問い合わせ方式)
[キャッシュメンテナンスシステムの概略]
図1を参照して、キャッシュメンテナンスシステム100の概略について説明する。図1に示すように、キャッシュメンテナンスシステム100は、キャッシュメンテナンス装置1と、データベース1Bと、キャッシュ1Cとを備える。ここで、キャッシュメンテナンスシステム100は、インターネット等のネットワークNを介して、キャッシュメンテナンス装置1と、データベース1Bと、キャッシュ1Cとを接続している。
(First embodiment: invalidation method or re-inquiry method)
[Outline of cache maintenance system]
An outline of the cache maintenance system 100 will be described with reference to FIG. As shown in FIG. 1, the cache maintenance system 100 includes a cache maintenance apparatus 1, a database 1B, and a cache 1C. Here, the cache maintenance system 100 connects the cache maintenance device 1, the database 1B, and the cache 1C via a network N such as the Internet.

キャッシュメンテナンス装置1は、データベース1Bに格納されたデータをキャッシュ1Cに保存する分散メモリキャッシュにおける、キャッシュエントリ1CEをメンテナンスするものであり、ここでは、無効化方式又は再問い合わせ方式を行う。なお、キャッシュメンテナンス装置1の構成については、後記する。   The cache maintenance device 1 maintains a cache entry 1CE in a distributed memory cache that stores data stored in the database 1B in the cache 1C. Here, an invalidation method or a requery method is performed. The configuration of the cache maintenance device 1 will be described later.

データベース1Bは、キャッシュ1Cの対象となるデータを格納するリレーショナルデータベース等の一般的なデータベースである。   The database 1B is a general database such as a relational database that stores data to be cached 1C.

キャッシュ1Cは、1以上のコンピュータのメモリで構成された分散メモリキャッシュである。ここで、キャッシュ1Cは、1個以上のキャッシュエントリ1CE,1CE・・・1CEを有することになる(但し、nは1以上の整数)。 The cache 1C is a distributed memory cache composed of one or more computer memories. Here, the cache 1C has one or more cache entries 1CE 1 , 1CE 2 ... 1CE n (where n is an integer of 1 or more).

キャッシュエントリ1CEは、データベース1Bのデータを保存し、アプリケーションにデータを提供するものである。ここで、キャッシュエントリ1CE、データベース1Bに格納されたデータをそのまま保存しても良く、データベース1Bに格納されたデータを加工(例えば、WebアプリケーションであればHTML形式に加工)して保存しても良い。   The cache entry 1CE stores data in the database 1B and provides data to the application. Here, the data stored in the cache entry 1CE and the database 1B may be stored as they are, or the data stored in the database 1B may be processed (for example, processed into HTML format for a Web application) and stored. good.

そして、データベース1Bに格納したデータとキャッシュエントリ1CEに保存したデータとの間に不整合が発生した場合、キャッシュメンテナンス装置1は、後記するメンテナンス条件を満たす場合、このキャッシュエントリ1CEのメンテナンスを行う。   When a mismatch occurs between the data stored in the database 1B and the data stored in the cache entry 1CE, the cache maintenance device 1 performs maintenance of the cache entry 1CE when a maintenance condition described later is satisfied.

[キャッシュメンテナンス装置の構成]
以下、図1を参照して、キャッシュメンテナンス装置1の構成について説明する。図1に示すように、キャッシュメンテナンス装置1は、更新情報記憶部11と、メンテナンス条件記憶部21と、メンテナンス条件生成部31と、メンテナンス対象選択部41と、メンテナンス判定部51と、キャッシュメンテナンス部61とを備える。
[Configuration of cache maintenance device]
Hereinafter, the configuration of the cache maintenance device 1 will be described with reference to FIG. As shown in FIG. 1, the cache maintenance device 1 includes an update information storage unit 11, a maintenance condition storage unit 21, a maintenance condition generation unit 31, a maintenance target selection unit 41, a maintenance determination unit 51, and a cache maintenance unit. 61.

更新情報記憶部11は、キャッシュエントリ更新情報(更新情報)を記憶するハードディスク等の記憶手段である。このキャッシュエントリ更新情報は、前回のメンテナンス時刻、及び、前回のメンテナンス時刻以後にデータが更新された回数を示す更新回数(メンテナンスカウント)の少なくとも一方を含むものである。ここでは、図2に示すように、キャッシュエントリ更新情報は、キャッシュエントリ1CEを一意に識別するキャッシュエントリ識別子と、前回のメンテナンス時刻以後にデータが更新された回数を示す更新回数を示すメンテナンスカウントと、前回にメンテナンスが行われた時刻である前回のメンテナンス時刻とを有する。   The update information storage unit 11 is a storage unit such as a hard disk that stores cache entry update information (update information). This cache entry update information includes at least one of a previous maintenance time and an update count (maintenance count) indicating the number of times data has been updated since the previous maintenance time. Here, as shown in FIG. 2, the cache entry update information includes a cache entry identifier that uniquely identifies the cache entry 1CE, a maintenance count that indicates the number of times the data has been updated since the previous maintenance time, , And the previous maintenance time which is the time when the maintenance was performed last time.

図1のメンテナンス条件記憶部21は、メンテナンス条件を記憶するハードディスク等の記憶手段である。このメンテナンス条件は、キャッシュエントリ1CEをメンテナンスする条件を示すものである。   The maintenance condition storage unit 21 in FIG. 1 is a storage unit such as a hard disk that stores maintenance conditions. This maintenance condition indicates a condition for maintaining the cache entry 1CE.

また、メンテナンス条件生成部31は、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、この入力に基づいて、メンテナンス条件を生成してメンテナンス条件記憶部21に書き込むものである。ここで、メンテナンス条件生成部31は、設定ファイルから許容遅延回数及び許容遅延時間の少なくとも一方を読み取り、又は、図示を省略したキーボード、マウス等の入力部によって、許容遅延回数及び許容遅延時間の少なくとも一方が入力される。   The maintenance condition generation unit 31 receives at least one of a preset allowable delay number and an allowable delay time, generates a maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit 21. Here, the maintenance condition generation unit 31 reads at least one of the allowable delay number and the allowable delay time from the setting file, or uses an input unit such as a keyboard or a mouse (not shown) to at least the allowable delay number and the allowable delay time. One is entered.

そして、メンテナンス条件生成部31は、メンテナンス条件を生成する。具体的には、メンテナンス条件生成部31は、許容遅延回数のみが入力された場合、メンテナンスカウントが許容遅延回数を超えたときにメンテナンス可能となるメンテナンス条件を生成する。例えば、メンテナンス条件生成部31は、許容遅延回数「10回」が入力された場合、図3(a)に示すように、「メンテナンスカウント>10回」というメンテナンス条件を生成する。   And the maintenance condition production | generation part 31 produces | generates a maintenance condition. Specifically, when only the allowable delay count is input, the maintenance condition generation unit 31 generates a maintenance condition that enables maintenance when the maintenance count exceeds the allowable delay count. For example, when the allowable delay count “10 times” is input, the maintenance condition generation unit 31 generates a maintenance condition “maintenance count> 10 times” as illustrated in FIG.

また、メンテナンス条件生成部31は、許容遅延時間のみが入力された場合、経過時間が許容遅延時間を超えたときにメンテナンス可能となるメンテナンス条件を生成する。例えば、メンテナンス条件生成部31は、許容遅延時間「10分」が入力された場合、図3(b)に示すように、「経過時間>10分」というメンテナンス条件を生成する。なお、経過時間は、前回のメンテナンス時刻から現在時刻までの時間である。また、現在時刻として、例えば、コンピュータの内蔵時計の時刻やNTP(Network Time Protocol)で取得した時刻を用いることができる。   In addition, when only the allowable delay time is input, the maintenance condition generating unit 31 generates a maintenance condition that enables maintenance when the elapsed time exceeds the allowable delay time. For example, when the allowable delay time “10 minutes” is input, the maintenance condition generation unit 31 generates a maintenance condition “elapsed time> 10 minutes” as illustrated in FIG. The elapsed time is the time from the previous maintenance time to the current time. Further, as the current time, for example, the time of the internal clock of the computer or the time acquired by NTP (Network Time Protocol) can be used.

また、メンテナンス条件生成部31は、許容遅延回数と許容遅延時間との両方が入力された場合、メンテナンスカウントが許容遅延回数を超えたとき又は経過時間が許容遅延時間を超えたときにメンテナンス可能となるメンテナンス条件を生成する。例えば、メンテナンス条件生成部31は、許容遅延回数「20回」と許容遅延時間「10分」とが入力された場合、図3(c)に示すように、「(メンテナンスカウント>20回)OR(経過時間>10分)」というメンテナンス条件を生成する。なお、図3(c)の「OR」は、OR条件であることを示す。なお、メンテナンス条件生成部31は、全てのキャッシュエントリ1CEで共通する、1個のメンテナンス条件を生成する。   In addition, when both the allowable delay count and the allowable delay time are input, the maintenance condition generation unit 31 can perform maintenance when the maintenance count exceeds the allowable delay count or when the elapsed time exceeds the allowable delay time. A maintenance condition is generated. For example, when the allowable delay number “20 times” and the allowable delay time “10 minutes” are input, the maintenance condition generation unit 31 performs “(maintenance count> 20 times) OR” as shown in FIG. (Elapsed time> 10 minutes) ”is generated. Note that “OR” in FIG. 3C indicates an OR condition. The maintenance condition generation unit 31 generates one maintenance condition that is common to all cache entries 1CE.

図1のメンテナンス対象選択部41は、キャッシュ1Cの全てのキャッシュエントリ1CEのうち、メンテナンスの対象となるキャッシュエントリ1CEを選択するものである。ここで、メンテナンス対象選択部41は、キャッシュエントリ1CEを選択すると共に、キャッシュエントリ更新情報を更新しても良い。例えば、メンテナンス対象選択部41は、メンテナンスカウントをインクリメントし、前回のメンテナンス時刻を現在時刻に更新する。このとき、メンテナンス対象選択部41は、データベース1Bに対する更新問い合わせ(登録、更新、削除)の一部又は全部を元に、メンテナンス対象を検索可能とするマッピングテーブルを用意する方法を用いる。また、メンテナンス対象選択部41は、例えば、データベース1Bに対する更新問い合わせの一部又は全部を入力として、メンテナンス対象を検索するため問い合わせ文を予め用意する方法がある。さらに、メンテナンス対象選択部41は、更新処理のあったテーブルを元に作られたキャッシュエントリ1CEを全てメンテナンス対象とする方法を用いても良く、前記した非特許文献3に記載の技術を用いても良い。   The maintenance target selection unit 41 in FIG. 1 selects a cache entry 1CE that is a maintenance target from among all the cache entries 1CE of the cache 1C. Here, the maintenance target selection unit 41 may select the cache entry 1CE and update the cache entry update information. For example, the maintenance target selection unit 41 increments the maintenance count and updates the previous maintenance time to the current time. At this time, the maintenance target selection unit 41 uses a method of preparing a mapping table that makes it possible to search for a maintenance target based on part or all of an update inquiry (registration, update, deletion) to the database 1B. Further, for example, the maintenance target selection unit 41 has a method of preparing an inquiry sentence in advance for searching for a maintenance target by inputting a part or all of an update inquiry to the database 1B. Furthermore, the maintenance target selection unit 41 may use a method in which all cache entries 1CE created based on the table that has undergone the update process are subject to maintenance, using the technique described in Non-Patent Document 3 described above. Also good.

メンテナンス判定部51は、メンテナンス条件記憶部21に記憶したメンテナンス条件を参照し、メンテナンス条件を満たすときにメンテナンス可能と判定するものである。ここで、メンテナンス判定部51は、更新情報記憶部11に記憶したキャッシュエントリ更新情報が更新された際、メンテナンス対象選択部41が選択したキャッシュエントリ1CEに対応するメンテナンスカウントと前回のメンテナンス時刻とを、更新情報記憶部11から読み出す。そして、メンテナンス判定部51は、メンテナンス条件にこの読み出したメンテナンスカウント及び前回のメンテナンス時刻の少なくとも一方を代入し、メンテナンス条件を満たすか否かを判定する。   The maintenance determination unit 51 refers to the maintenance conditions stored in the maintenance condition storage unit 21 and determines that maintenance is possible when the maintenance conditions are satisfied. Here, when the cache entry update information stored in the update information storage unit 11 is updated, the maintenance determination unit 51 determines the maintenance count corresponding to the cache entry 1CE selected by the maintenance target selection unit 41 and the previous maintenance time. Read from the update information storage unit 11. Then, the maintenance determination unit 51 assigns at least one of the read maintenance count and the previous maintenance time to the maintenance condition, and determines whether the maintenance condition is satisfied.

キャッシュメンテナンス部61は、メンテナンス判定部51がメンテナンス可能と判定した場合、キャッシュエントリ1CEをメンテナンスするものである。ここで、無効化方式を採用した場合、キャッシュメンテナンス部61は、メンテナンス判定部51がメンテナンス可能と判定したら、メンテナンス対象選択部41が選択したキャッシュエントリ1CEを無効化することを示す無効化メッセージをキャッシュ1Cに送信する。   The cache maintenance unit 61 maintains the cache entry 1CE when the maintenance determination unit 51 determines that maintenance is possible. When the invalidation method is employed, the cache maintenance unit 61 issues an invalidation message indicating that the cache entry 1CE selected by the maintenance target selection unit 41 is invalidated when the maintenance determination unit 51 determines that maintenance is possible. Send to cache 1C.

また、再問い合わせ方式を採用した場合、キャッシュメンテナンス部61は、無効化メッセージを送信した後、データベース1Bにこのキャッシュエントリ1CEに保存するデータを取得するための問い合わせを行う。そして、キャッシュメンテナンス部61は、この問い合わせ結果をキャッシュ1Cにキャッシュエントリ1CEとして保存する。なお、無効化方式及び再問い合わせ方式の詳細については、前記した非特許文献1,2,3,5に記載されている。   When the re-inquiry method is adopted, the cache maintenance unit 61 transmits an invalidation message and then makes an inquiry to the database 1B for acquiring data to be stored in the cache entry 1CE. Then, the cache maintenance unit 61 stores the inquiry result in the cache 1C as the cache entry 1CE. The details of the invalidation method and the re-inquiry method are described in Non-Patent Documents 1, 2, 3, and 5 described above.

[キャッシュメンテナンス装置の動作]
<全体動作>
以下、図4を参照して、キャッシュメンテナンス装置1の全体動作について説明する(適宜図1参照)。まず、図4に示すように、キャッシュメンテナンス装置1は、メンテナンス条件生成部31によって、許容遅延回数及び許容遅延時間の少なくとも一方が入力され、この入力に基づいて、メンテナンス条件を生成してメンテナンス条件記憶部21に書き込む(ステップS1)。
[Operation of the cache maintenance device]
<Overall operation>
Hereinafter, the overall operation of the cache maintenance apparatus 1 will be described with reference to FIG. 4 (see FIG. 1 as appropriate). First, as shown in FIG. 4, in the cache maintenance device 1, at least one of the allowable delay number and the allowable delay time is input by the maintenance condition generation unit 31, and the maintenance condition is generated based on the input. Write to the storage unit 21 (step S1).

ステップS1の処理に続いて、キャッシュメンテナンス装置1は、キャッシュエントリ1CEのメンテナンスを行う(ステップS2)。なお、ステップS2の詳細は、後記する。   Following the processing in step S1, the cache maintenance device 1 performs maintenance on the cache entry 1CE (step S2). Details of step S2 will be described later.

ステップS2の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、メンテナンスを終了するか否かを判定する(ステップS3)。例えば、入力部にユーザからの終了命令が入力された場合、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、メンテナンスを終了すると判定する。   Following the processing of step S2, the cache maintenance device 1 determines whether or not the maintenance is to be ended by the maintenance determination unit 51 (step S3). For example, when an end command is input from the user to the input unit, the cache maintenance device 1 determines that the maintenance is ended by the maintenance determination unit 51.

ここで、メンテナンスを終了すると判定した場合(ステップS3でYes)、キャッシュメンテナンス装置1は、処理を終了する。一方、メンテナンスを終了しないと判定した場合(ステップS3でNo)、キャッシュメンテナンス装置1は、ステップS2の処理に戻る。   If it is determined that the maintenance is to be ended (Yes in step S3), the cache maintenance device 1 ends the process. On the other hand, when it is determined that the maintenance is not finished (No in step S3), the cache maintenance device 1 returns to the process of step S2.

<ステップS2の詳細:メンテナンス>
以下、図5を参照して、図4のステップS2(メンテナンス)の詳細について説明する。まず、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、キャッシュ1Cの全てのキャッシュエントリ1CEのうち、メンテナンスの対象となるキャッシュエントリ1CEを判定する(ステップS20)。具体的には、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、メンテナンスが行われていない未処理キャッシュエントリ識別値のリスト(未処理リスト)を出力する。
<Details of Step S2: Maintenance>
The details of step S2 (maintenance) in FIG. 4 will be described below with reference to FIG. First, in the cache maintenance device 1, the maintenance target selection unit 41 determines a cache entry 1CE that is a maintenance target among all the cache entries 1CE of the cache 1C (step S20). Specifically, the cache maintenance device 1 outputs a list (unprocessed list) of unprocessed cache entry identification values that are not maintained by the maintenance target selection unit 41.

ステップS20の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、ステップS20で出力した未処理リストに基づいて、メンテナンスを行うキャッシュエントリ1CEを任意に選択する(ステップS21)。例えば、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、この未処理リストに含まれるキャッシュエントリ識別子をソートし、ソート順にキャッシュエントリ1CEを選択する。また、例えば、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、この未処理リストに含まれるキャッシュエントリ1CEをランダムに選択する。そして、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、選択したキャッシュエントリ1CEを示すキャッシュエントリ識別子を出力する。   Following the processing in step S20, the cache maintenance device 1 arbitrarily selects the cache entry 1CE to be maintained based on the unprocessed list output in step S20 by the maintenance target selection unit 41 (step S21). For example, the cache maintenance device 1 sorts the cache entry identifiers included in the unprocessed list by the maintenance target selection unit 41, and selects the cache entries 1CE in the sort order. In addition, for example, the cache maintenance device 1 uses the maintenance target selection unit 41 to randomly select the cache entry 1CE included in this unprocessed list. Then, the cache maintenance device 1 outputs a cache entry identifier indicating the selected cache entry 1CE by the maintenance target selection unit 41.

ステップS21の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス対象選択部41によって、ステップS20で出力したキャッシュエントリ識別子に対応するキャッシュエントリ1CEについて、キャッシュエントリ更新情報のメンテナンスカウントを更新(インクリメント)する(ステップS22)。   Following the processing in step S21, the cache maintenance device 1 updates (increments) the maintenance count of the cache entry update information for the cache entry 1CE corresponding to the cache entry identifier output in step S20 by the maintenance target selection unit 41. (Step S22).

ステップS22の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、メンテナンス条件を評価する(ステップS23)。そして、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、この評価結果に応じた真偽値を出力する。なお、ステップS23の詳細は、後記する。   Following the processing of step S22, the cache maintenance device 1 evaluates the maintenance conditions by the maintenance determination unit 51 (step S23). Then, the cache maintenance device 1 outputs a truth value corresponding to the evaluation result by the maintenance determination unit 51. Details of step S23 will be described later.

ステップS23の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、メンテナンス条件を満たすか否かを判定する(ステップS24)。例えば、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、ステップS23で出力した真偽値が「真」のとき、メンテナンス条件を満たしメンテナンス可能と判定する。また、例えば、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、ステップS23で出力した真偽値が「偽」のとき、メンテナンス条件を満たさずメンテナンス不可能と判定する。   Following the processing of step S23, the cache maintenance device 1 determines whether the maintenance condition is satisfied by the maintenance determination unit 51 (step S24). For example, when the true / false value output in step S23 is “true” by the maintenance determination unit 51, the cache maintenance device 1 determines that the maintenance condition is satisfied and maintenance is possible. Further, for example, the cache maintenance device 1 determines that maintenance is not possible because the maintenance determination unit 51 does not satisfy the maintenance condition when the true / false value output in step S23 is “false”.

ここで、メンテナンス可能と判定した場合(ステップ24でYes)、キャッシュメンテナンス装置1は、ステップS25の処理に進む。一方、メンテナンス不可能と判定した場合(ステップS24でNo)、キャッシュメンテナンス装置1は、ステップS27の処理に進む。   If it is determined that maintenance is possible (Yes in step 24), the cache maintenance device 1 proceeds to the process of step S25. On the other hand, when it is determined that maintenance is not possible (No in step S24), the cache maintenance device 1 proceeds to the process of step S27.

ステップ24の処理に続いて、キャッシュメンテナンス装置1は、キャッシュメンテナンス部61によって、ステップS20で出力したキャッシュエントリ識別子に対応するキャッシュエントリ1CEのメンテナンスを行う(ステップS25)。   Following the processing in step 24, the cache maintenance device 1 performs maintenance of the cache entry 1CE corresponding to the cache entry identifier output in step S20 by the cache maintenance unit 61 (step S25).

ステップ25の処理に続いて、キャッシュメンテナンス装置1は、キャッシュメンテナンス部61によって、ステップS20で出力したキャッシュエントリ識別子に対応するキャッシュエントリ1CEについて、キャッシュエントリ更新情報を更新する(ステップS26)。例えば、キャッシュメンテナンス装置1は、キャッシュメンテナンス部61によって、キャッシュエントリ更新情報のメンテナンスカウントを「0」に更新(リセット)し、前回のメンテナンス時刻を現在時刻で更新する。なお、ステップS26では、キャッシュエントリ更新情報として、キャッシュエントリ参照回数を記憶して利用する場合、これらの値の更新(リセット)を行っても良い。   Following the processing in step 25, the cache maintenance device 1 updates the cache entry update information for the cache entry 1CE corresponding to the cache entry identifier output in step S20 by the cache maintenance unit 61 (step S26). For example, the cache maintenance device 1 causes the cache maintenance unit 61 to update (reset) the maintenance count of the cache entry update information to “0” and update the previous maintenance time with the current time. In step S26, when the cache entry reference count is stored and used as the cache entry update information, these values may be updated (reset).

ステップ26の処理又はステップS24でNoの後に続いて、キャッシュメンテナンス装置1は、キャッシュメンテナンス部61によって、ステップS20で出力した未処理リストに含まれる、全てのメンテナンス対象となるキャッシュエントリ1CEを処理(メンテナンス)したか否かを判定する(ステップS27)。   Following the processing in step 26 or No in step S24, the cache maintenance device 1 processes all the cache entries 1CE to be maintained included in the unprocessed list output in step S20 by the cache maintenance unit 61 ( It is determined whether or not maintenance has been performed (step S27).

ここで、全てのメンテナンス対象を処理したと判定した場合(ステップS27でYes)、キャッシュメンテナンス装置1は、メンテナンスを終了する。一方、全てのメンテナンス対象を処理していないと判定した場合(ステップS27でNo)、キャッシュメンテナンス装置1は、ステップS21の処理に戻る。   If it is determined that all the maintenance targets have been processed (Yes in step S27), the cache maintenance device 1 ends the maintenance. On the other hand, when it is determined that not all the maintenance targets have been processed (No in step S27), the cache maintenance device 1 returns to the process of step S21.

<ステップS23の詳細:メンテナンス条件の評価>
以下、図6を参照して、図5のステップS23(メンテナンス条件を評価)の詳細について説明する。まず、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、ステップS20で出力したキャッシュエントリ識別子に対応するキャッシュエントリ1CEについて、メンテナンス条件記憶部21を参照してメンテナンス条件を取得し、更新情報記憶部11を参照してキャッシュエントリ更新情報を取得する(ステップS231)。
<Details of Step S23: Evaluation of Maintenance Conditions>
The details of step S23 (evaluation of maintenance conditions) in FIG. 5 will be described below with reference to FIG. First, the cache maintenance device 1 acquires the maintenance condition for the cache entry 1CE corresponding to the cache entry identifier output in step S20 by the maintenance determination unit 51 with reference to the maintenance condition storage unit 21, and updates the information storage unit 11 To obtain cache entry update information (step S231).

ステップS231の処理に続いて、キャッシュメンテナンス装置1は、メンテナンス判定部51によって、ステップS231で取得したメンテナンス条件にステップS231で取得したキャッシュエントリ更新情報を代入してメンテナンス条件を評価し、この評価結果に応じた真偽値を出力する(ステップS232)。   Subsequent to the processing of step S231, the cache maintenance device 1 uses the maintenance determination unit 51 to evaluate the maintenance condition by substituting the cache entry update information acquired in step S231 for the maintenance condition acquired in step S231. A true / false value corresponding to is output (step S232).

以上のように、第1実施形態に係るキャッシュメンテナンス装置1は、メンテナンス条件を満たす場合にのみ、キャッシュエントリ1CEのメンテナンスを行うため、データベース1Bに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。また、キャッシュメンテナンス装置1は、無効化方式を採用したときは、メンテナンスによってキャッシュエントリ1CEが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。さらに、キャッシュメンテナンス装置1は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。   As described above, since the cache maintenance device 1 according to the first embodiment performs maintenance of the cache entry 1CE only when the maintenance condition is satisfied, the cache maintenance device 1 is referred even in an environment where update processing is frequently performed on the database 1B. The speed does not decrease, and the increase in processing load can be minimized. Further, when the cache maintenance apparatus 1 adopts the invalidation method, the frequency of invalidating the cache entry 1CE due to maintenance is reduced, so that the cache hit rate is greatly improved. Furthermore, when the re-inquiry method is adopted, the cache maintenance apparatus 1 can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance. .

なお、キャッシュメンテナンス装置1を独立した装置として説明したが、本発明は、これに限定されない。例えば、図7に示すように、本発明は、ディスプレイ等の表示部Oと、キーボード、マウス等の入力部Iと、演算装置Cと、メモリ、ハードディスク等の記憶装置HとをシステムバスBで接続した一般的なコンピュータで実現できる。具体的には、本発明は、このコンピュータの記憶装置Hを更新情報記憶部11及びメンテナンス条件記憶部21として協調動作させ、演算装置Cをメンテナンス条件生成部31、メンテナンス対象選択部41、メンテナンス判定部51及びキャッシュメンテナンス部61として協調動作させるキャッシュメンテナンスプログラムによって実現できる。このプログラムは、ネットワークNを介して配布しても良く、CD−ROMやフラッシュメモリ等の記録媒体に書き込んで配布しても良い。この点、以後の実施形態でも同様である。   Although the cache maintenance device 1 has been described as an independent device, the present invention is not limited to this. For example, as shown in FIG. 7, the present invention provides a system bus B that includes a display unit O such as a display, an input unit I such as a keyboard and a mouse, an arithmetic device C, and a storage device H such as a memory and a hard disk. It can be realized with a connected general computer. Specifically, the present invention causes the storage device H of this computer to operate cooperatively as the update information storage unit 11 and the maintenance condition storage unit 21, and the arithmetic device C to operate the maintenance condition generation unit 31, the maintenance target selection unit 41, the maintenance determination. This can be realized by a cache maintenance program that operates in cooperation as the unit 51 and the cache maintenance unit 61. This program may be distributed via the network N, or may be distributed by writing in a recording medium such as a CD-ROM or a flash memory. This also applies to the following embodiments.

(第2実施形態:差分更新方式)
[キャッシュメンテナンスシステムの概略]
以下、図8を参照して、第2実施形態に係るキャッシュメンテナンスシステム200の概略について、第1実施形態と異なる点を主に説明する。ここで、メンテナンスを行う際、不整合なキャッシュエントリ2CE内のデータを全て破棄してから再計算する再問い合わせ方式に比べ、キャッシュエントリ2CE内の一部分のみを更新する差分更新方式の方が、一般的には演算量が少なくなる。この差分更新方式は、どのようなキャッシュ2Cでも適用できるわけではなく、一定のデータベース環境を満たしている必要がある。キャッシュメンテナンスシステム200は、このような差分更新方式を採用する場合の一例である。
(Second embodiment: differential update method)
[Outline of cache maintenance system]
Hereinafter, with reference to FIG. 8, the outline of the cache maintenance system 200 according to the second embodiment will be mainly described in terms of differences from the first embodiment. Here, when performing maintenance, the differential update method in which only a part in the cache entry 2CE is updated is more general than the requery method in which all the data in the inconsistent cache entry 2CE is discarded and then recalculated. Therefore, the calculation amount is reduced. This differential update method is not applicable to any cache 2C and needs to satisfy a certain database environment. The cache maintenance system 200 is an example when such a differential update method is adopted.

データベース2Bは、元から格納されているテーブルTに加えて、このテーブルT毎に、差分データを一時的に保存するための差分テーブルΔTを格納するリレーショナルデータベースである。この差分テーブルΔTは、テーブルTに登録(INSERT)されたレコードのみを格納するものである。なお、図8では、差分テーブルΔT及びテーブルTをそれぞれ1個示したが、差分テーブルΔT及びテーブルTは、それぞれ複数であっても良い。   The database 2B is a relational database that stores a difference table ΔT for temporarily storing difference data for each table T in addition to the table T stored from the beginning. This difference table ΔT stores only records registered (INSERT) in the table T. In FIG. 8, one difference table ΔT and one table T are shown, but there may be a plurality of difference tables ΔT and tables T.

キャッシュ2Cは、図1のキャッシュ1Cと同様のものである。また、キャッシュエントリ2CEは、データベース2Bの問い合わせ結果を保存の対象とする。   The cache 2C is the same as the cache 1C in FIG. The cache entry 2CE stores the inquiry result of the database 2B as a storage target.

[キャッシュメンテナンス装置の構成]
以下、第2実施形態に係るキャッシュメンテナンス装置2の構成について、第1実施形態と異なる点を主に説明する。図8に示すように、キャッシュメンテナンス装置2は、メンテナンス条件記憶部22と、メンテナンス条件生成部32と、メンテナンス判定部52と、キャッシュ差分メンテナンス部(キャッシュメンテナンス部)62とを備える。なお、キャッシュ差分メンテナンス部62が、請求項に記載のキャッシュメンテナンス部に相当する。
[Configuration of cache maintenance device]
In the following, the configuration of the cache maintenance device 2 according to the second embodiment will be described mainly with respect to differences from the first embodiment. As shown in FIG. 8, the cache maintenance device 2 includes a maintenance condition storage unit 22, a maintenance condition generation unit 32, a maintenance determination unit 52, and a cache differential maintenance unit (cache maintenance unit) 62. The cache difference maintenance unit 62 corresponds to the cache maintenance unit described in the claims.

メンテナンス条件記憶部22は、メンテナンス条件を記憶するハードディスク等の記憶手段である。このメンテナンス条件は、後記するメンテナンス判定部52が、差分テーブルΔTに格納したデータの件数や最も古いデータの時刻等の情報と比較して、テーブルTに対応するキャッシュエントリ2CEの更新を行うか否かを判定する条件式である。例えば、メンテナンス条件は、差分テーブルΔTの差分データの件数をAnとすると、「An>10件」のような条件となる。   The maintenance condition storage unit 22 is a storage unit such as a hard disk that stores maintenance conditions. Whether or not the maintenance determination unit 52 described later updates the cache entry 2CE corresponding to the table T by comparing the information with information such as the number of data stored in the difference table ΔT and the time of the oldest data. This is a conditional expression for determining whether or not. For example, the maintenance condition is a condition such as “An> 10” when the number of difference data in the difference table ΔT is An.

メンテナンス条件生成部32は、データベース2Bに格納されたテーブルT毎に、メンテナンス条件を生成してメンテナンス条件記憶部24に書き込むものである。なお、メンテナンス条件生成部32のメンテナンス条件の生成手法は、図1のメンテナンス条件生成部31と同様のものであるため、説明を省略する。   The maintenance condition generation unit 32 generates a maintenance condition for each table T stored in the database 2B and writes it in the maintenance condition storage unit 24. The maintenance condition generation method of the maintenance condition generation unit 32 is the same as that of the maintenance condition generation unit 31 of FIG.

メンテナンス判定部52は、データベース2BのテーブルTにおける差分データを格納した差分テーブルΔTを参照し、差分テーブルΔTのデータ件数をメンテナンスカウントとして算出するものである。また、メンテナンス判定部52は、差分テーブルΔTにおける最も古いデータを格納した時刻から現在時刻までを経過時間として算出する。そして、メンテナンス判定部52は、メンテナンス条件記憶部22に記憶したメンテナンス条件を参照し、算出した更新回数と経過時間とをメンテナンス条件に代入して、このメンテナンス条件を満たすときにメンテナンス可能と判定する。   The maintenance determination unit 52 refers to the difference table ΔT storing the difference data in the table T of the database 2B, and calculates the number of data items in the difference table ΔT as a maintenance count. Further, the maintenance determination unit 52 calculates the elapsed time from the time when the oldest data in the difference table ΔT is stored to the current time. Then, the maintenance determination unit 52 refers to the maintenance condition stored in the maintenance condition storage unit 22, substitutes the calculated update count and elapsed time into the maintenance condition, and determines that maintenance is possible when this maintenance condition is satisfied. .

キャッシュ差分メンテナンス部62は、メンテナンス判定部52がメンテナンス可能と判定したキャッシュエントリ2CEについて、差分テーブルΔTに格納した差分データをキャッシュエントリ2CEに一括して更新(メンテナンス)するものである。そして、キャッシュ差分メンテナンス部62は、一括して更新した差分データを差分テーブルΔTから削除する。   The cache difference maintenance unit 62 updates (maintains) the difference data stored in the difference table ΔT in the cache entry 2CE for the cache entry 2CE that the maintenance determination unit 52 has determined that maintenance is possible. Then, the cache difference maintenance unit 62 deletes the difference data updated together from the difference table ΔT.

以下、図9を参照して、キャッシュ差分メンテナンス部62によるメンテナンスについて、具体的に説明する(適宜図8参照)。図9に示すように、データベース2Bは、図示を省略した「message」というテーブルと、「Δmessage」という差分テーブルΔTと、「follower」というテーブルTとを格納している。この差分テーブルΔTは、idが6〜9の4レコードが格納されている。   Hereinafter, the maintenance by the cache difference maintenance unit 62 will be specifically described with reference to FIG. 9 (see FIG. 8 as appropriate). As shown in FIG. 9, the database 2B stores a table “message” (not shown), a difference table ΔT “Δmessage”, and a table T “follower”. This difference table ΔT stores four records with ids of 6-9.

ここで、キャッシュエントリ2CEの更新(メンテナンス)を行う場合、キャッシュ差分メンテナンス部62は、1個のキャッシュエントリ2CEに複数の差分データを一括して更新するための一括差分データを求める。例えば、キャッシュ差分メンテナンス部62は、この一括差分データを求めるために、問い合わせQ2をデータベース2Bに行う。この問い合わせQ2は、図25の問い合わせ9Qと比べ、差分テーブルΔTの全レコードを用いている点、及び、キャッシュエントリ2CEのkeyを用いてグループ化を行う点が異なっている。そして、キャッシュ差分メンテナンス部62は、一括差分データを、キャッシュエントリ2CEのkeyに対応するグループ毎に、キャッシュエントリ2CEに更新する。つまり、キャッシュ差分メンテナンス部62は、1以上の差分データをキャッシュエントリ2CEに一括更新(メンテナンス)する。   Here, when updating (maintenance) the cache entry 2CE, the cache difference maintenance unit 62 obtains batch difference data for updating a plurality of difference data in one cache entry 2CE in a batch. For example, the cache difference maintenance unit 62 makes an inquiry Q2 to the database 2B in order to obtain the batch difference data. This query Q2 differs from the query 9Q in FIG. 25 in that all records in the difference table ΔT are used and that grouping is performed using the key of the cache entry 2CE. Then, the cache difference maintenance unit 62 updates the batch difference data to the cache entry 2CE for each group corresponding to the key of the cache entry 2CE. That is, the cache difference maintenance unit 62 collectively updates (maintains) one or more pieces of difference data to the cache entry 2CE.

[キャッシュメンテナンス装置の動作]
<ステップS2の詳細:メンテナンス>
キャッシュメンテナンス装置2は、図4と同じ全体動作を行うため、説明を省略する。以下、キャッシュメンテナンス装置2における、図4のステップS2の動作が異なるため、図10を参照し、これを説明する。
[Operation of the cache maintenance device]
<Details of Step S2: Maintenance>
The cache maintenance device 2 performs the same overall operation as in FIG. Hereinafter, since the operation of step S2 in FIG. 4 in the cache maintenance device 2 is different, this will be described with reference to FIG.

予め、データベース2Bは、このデータベース2Bに対する更新を蓄積、つまり、差分テーブルを生成する(ステップS30)。ここで、データベース2Bは、このデータベース2Bに対する登録(INSERT)問い合わせが入力され、この問い合わせに記述されたレコードをテーブルTに登録する。このとき、データベース2Bは、このレコードを差分テーブルΔTにも登録する。なお、ステップS30の処理は、キャッシュメンテナンス装置2の動作でないことを明確にするため、破線で図示した。   In advance, the database 2B accumulates updates to the database 2B, that is, generates a difference table (step S30). Here, the database 2B receives a registration (INSERT) query for the database 2B and registers the record described in the query in the table T. At this time, the database 2B also registers this record in the difference table ΔT. In addition, in order to clarify that the process of step S30 is not operation | movement of the cache maintenance apparatus 2, it illustrated in the broken line.

ステップS31及びステップS32の処理は、図5のステップ23及びS24と同様のものであるため、説明を省略する。   The processing in step S31 and step S32 is the same as that in steps 23 and S24 in FIG.

ステップ32の処理に続いて、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、キャッシュエントリ2CEの一括更新(メンテナンス)を行う(ステップS33)。   Following the processing of step 32, the cache maintenance device 2 performs batch update (maintenance) of the cache entry 2CE by the cache difference maintenance unit 62 (step S33).

<ステップS33の詳細:キャッシュエントリの一括更新>
以下、図11を参照して、図10のステップS33(キャッシュエントリの一括更新)の詳細について説明する。まず、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、差分テーブルΔTとテーブルTとから、一括差分データを求める(ステップS331)。ここでは、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、データベース2Bに図9の問い合わせQ2を行い、全てのキャッシュエントリ2CEについての一括差分データを求める。
<Details of Step S33: Batch Update of Cache Entries>
Hereinafter, with reference to FIG. 11, the details of step S33 (batch update of cache entries) of FIG. 10 will be described. First, the cache maintenance device 2 obtains batch difference data from the difference table ΔT and the table T by the cache difference maintenance unit 62 (step S331). Here, the cache maintenance device 2 uses the cache difference maintenance unit 62 to make an inquiry Q2 in FIG. 9 to the database 2B to obtain batch difference data for all the cache entries 2CE.

ステップS331の処理に続いて、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、ステップS331で求めた一括差分データで1個のキャッシュエントリ2CEを一括更新する(ステップS332)。そして、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、一括差分データを更新したキャッシュエントリ2CEに対応するテーブルTの識別子(例えば、テーブルTの名称)と、一括更新が行われていないキャッシュエントリ2CEの一括差分データである未処理一括差分データとを出力する。   Following the processing in step S331, the cache maintenance device 2 uses the cache difference maintenance unit 62 to batch update one cache entry 2CE with the batch difference data obtained in step S331 (step S332). Then, the cache maintenance device 2 uses the cache difference maintenance unit 62 to identify the identifier of the table T (for example, the name of the table T) corresponding to the cache entry 2CE that has updated the batch difference data, and the cache entry that has not been batch updated. Unprocessed batch differential data that is 2CE batch differential data is output.

ステップS332の処理に続いて、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、一括差分データを全て処理したか否かを判定する(ステップS333)。ここでは、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、ステップS332で未処理一括差分データが出力されなかったとき、一括差分データを全て処理したと判定する。   Following the processing in step S332, the cache maintenance device 2 determines whether or not all the batch difference data has been processed by the cache difference maintenance unit 62 (step S333). Here, the cache maintenance device 2 determines that all the batch difference data has been processed when the cache difference maintenance unit 62 does not output the unprocessed batch difference data in step S332.

ここで、一括差分データを全て処理したと判定した場合(ステップS333でYes)、キャッシュメンテナンス装置2は、ステップS334の処理に進む。一方、一括差分データを全て処理していないと判定した場合(ステップS333でNo)、キャッシュメンテナンス装置2は、ステップS332の処理に戻る。   If it is determined that all the batch difference data has been processed (Yes in step S333), the cache maintenance device 2 proceeds to the process of step S334. On the other hand, when it is determined that all the batch difference data has not been processed (No in step S333), the cache maintenance device 2 returns to the process of step S332.

ステップS333の処理に続いて、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、ステップS332で更新した一括差分データを差分テーブルΔTから削除する(ステップS334)。ここでは、キャッシュメンテナンス装置2は、キャッシュ差分メンテナンス部62によって、ステップS332で出力した識別子が示す全てのテーブルTについて、このテーブルTの全レコードを削除(DELETE)する。   Following the processing in step S333, the cache maintenance device 2 deletes the batch difference data updated in step S332 from the difference table ΔT by the cache difference maintenance unit 62 (step S334). Here, the cache maintenance device 2 deletes (DELETE) all the records in the table T for all the tables T indicated by the identifier output in step S332 by the cache difference maintenance unit 62.

以上のように、第2実施形態に係るキャッシュメンテナンス装置2は、メンテナンス条件を満たす場合にのみ、キャッシュエントリ2CEのメンテナンスを行うため、データベース2Bに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。また、キャッシュメンテナンス装置2は、メンテナンス条件を満たす場合にのみ差分データでキャッシュエントリ2CEを一括更新し、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置2は、差分更新方式を採用したときは、メンテナンスによって逐次差分データをキャッシュエントリ2CCEに更新する場合に比べて、問い合わせ処理及び通信処理のオーバーヘッドが大幅に少ないため、メンテナンスコストを大幅に削減できる。   As described above, since the cache maintenance device 2 according to the second embodiment performs maintenance of the cache entry 2CE only when the maintenance condition is satisfied, the cache maintenance device 2 is referred even in an environment where update processing is frequently performed on the database 2B. The speed does not decrease, and the increase in processing load can be minimized. In addition, the cache maintenance device 2 updates the cache entry 2CE in batch with the difference data only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the differential maintenance method is adopted, the cache maintenance device 2 has much lower overhead of inquiry processing and communication processing than the case where sequential differential data is updated to the cache entry 2CCE by maintenance. Can be greatly reduced.

(第3実施形態:無効化方式又は再問い合わせ方式)
[キャッシュメンテナンス装置の構成]
以下、図12を参照して、第3実施形態に係るキャッシュメンテナンス装置3の構成について、第1実施形態と異なる点を主に説明する。キャッシュメンテナンス装置3は、統計情報を用いて、予め設定された目標負荷を達成するまでメンテナンスを行う点が、キャッシュメンテナンス装置1と大きく相違する。
(Third embodiment: Invalidation method or re-inquiry method)
[Configuration of cache maintenance device]
Hereinafter, with reference to FIG. 12, the configuration of the cache maintenance device 3 according to the third embodiment will be described mainly with respect to differences from the first embodiment. The cache maintenance device 3 is greatly different from the cache maintenance device 1 in that maintenance is performed until a preset target load is achieved using statistical information.

このため、図12に示すように、キャッシュメンテナンス装置3は、更新情報記憶部13と、メンテナンス条件記憶部23と、メンテナンス条件生成部33と、メンテナンス対象選択部43と、メンテナンス判定部53と、キャッシュメンテナンス部63と、統計情報算出部73とを備える。   Therefore, as shown in FIG. 12, the cache maintenance device 3 includes an update information storage unit 13, a maintenance condition storage unit 23, a maintenance condition generation unit 33, a maintenance target selection unit 43, a maintenance determination unit 53, A cache maintenance unit 63 and a statistical information calculation unit 73 are provided.

更新情報記憶部13は、キャッシュエントリ更新情報を記憶するハードディスク等の記憶手段である。ここでは、図13に示すように、キャッシュエントリ更新情報は、キャッシュエントリ識別子と、メンテナンスカウントと、前回のメンテナンス時刻と、累積参照回数と、累積メンテナンス回数とを有する。この累積参照回数は、予め設定された統計期間におけるキャッシュエントリ3CEが参照された参照回数の累積値である。また、この累積メンテナンス回数は、統計期間におけるキャッシュエントリ3CEをメンテナンスした回数を示すメンテナンス回数の累積値である。つまり、キャッシュエントリ更新情報のデータ項目のうち、累積参照回数及び累積メンテナンス回数がキャッシュエントリ統計情報(統計情報)となる。なお、累積参照回数及び累積メンテナンス回数は、後記する統計情報算出部73がキャッシュエントリ更新情報に書き込む。   The update information storage unit 13 is a storage unit such as a hard disk that stores cache entry update information. Here, as shown in FIG. 13, the cache entry update information includes a cache entry identifier, a maintenance count, a previous maintenance time, a cumulative reference count, and a cumulative maintenance count. This cumulative reference count is a cumulative value of the reference count for which the cache entry 3CE is referenced in a preset statistical period. The cumulative maintenance count is a cumulative value of the maintenance count indicating the number of times that the cache entry 3CE is maintained in the statistical period. That is, among the data items of the cache entry update information, the cumulative reference count and the cumulative maintenance count become the cache entry statistical information (statistical information). The accumulated reference count and the accumulated maintenance count are written in the cache entry update information by the statistical information calculation unit 73 described later.

図12のメンテナンス条件記憶部23は、メンテナンス条件を記憶するハードディスク等の記憶手段である。ここでは、図14に示すように、メンテナンス条件は、キャッシュエントリ3CE毎に生成される。   The maintenance condition storage unit 23 in FIG. 12 is a storage unit such as a hard disk that stores maintenance conditions. Here, as shown in FIG. 14, the maintenance condition is generated for each cache entry 3CE.

図12のメンテナンス条件生成部33は、予め設定された許容遅延回数及び許容遅延時間の少なくとも一方と、メンテナンスコストの目標負荷値とが入力され、この入力に基づいて、キャッシュエントリ3CE毎に、メンテナンス条件を生成してメンテナンス条件記憶部23に書き込むものである。ここで、メンテナンス条件生成部33は、キャッシュエントリ3CE毎に、許容遅延回数及び許容遅延時間の少なくとも一方が入力される。さらに、メンテナンス条件生成部33は、設定ファイルから目標負荷値を読み取り、又は、入力部によって目標負荷値が入力される。ここで、この目標負荷値は、例えば、0を超え、かつ、100未満の値で入力される。   The maintenance condition generation unit 33 in FIG. 12 receives at least one of a preset allowable delay count and allowable delay time and a maintenance load target load value, and performs maintenance for each cache entry 3CE based on this input. A condition is generated and written in the maintenance condition storage unit 23. Here, the maintenance condition generation unit 33 receives at least one of the allowable delay count and the allowable delay time for each cache entry 3CE. Further, the maintenance condition generation unit 33 reads the target load value from the setting file, or the target load value is input by the input unit. Here, the target load value is input as a value exceeding 0 and less than 100, for example.

そして、メンテナンス条件生成部33は、目標負荷を達成するか、又は、全てのキャッシュエントリ3CEのメンテナンス条件を生成するまで、キャッシュエントリ3CE毎にメンテナンス条件を生成する。このとき、メンテナンス条件生成部33は、メンテナンス条件生成部33は、メンテナンス条件を生成しておらず、かつ、メンテナンス回数の累積値が最大となるキャッシュエントリ3CEを選択することが好ましい。又は、メンテナンス対象選択部43は、メンテナンス条件生成部33がメンテナンス条件を生成しておらず、かつ、参照回数の累積値が最小となるキャッシュエントリ3CEを選択することが好ましい。なお、メンテナンス条件の生成の詳細については、後記する。   Then, the maintenance condition generation unit 33 generates a maintenance condition for each cache entry 3CE until the target load is achieved or the maintenance conditions for all the cache entries 3CE are generated. At this time, it is preferable that the maintenance condition generation unit 33 selects the cache entry 3CE in which the maintenance condition generation unit 33 has not generated the maintenance condition and the cumulative value of the number of times of maintenance is maximized. Alternatively, it is preferable that the maintenance target selection unit 43 selects the cache entry 3CE in which the maintenance condition generation unit 33 has not generated the maintenance condition and the cumulative value of the reference count is minimized. Details of generation of maintenance conditions will be described later.

メンテナンス対象選択部43は、図1のメンテナンス対象選択部41と同様に、キャッシュエントリ3CEを選択するものである。   The maintenance target selection unit 43 selects the cache entry 3CE, similarly to the maintenance target selection unit 41 of FIG.

メンテナンス判定部53は、図1のメンテナンス判定部51と同様に、メンテナンス対象選択部43が選択したキャッシュエントリ3CEについて、メンテナンス条件記憶部21に記憶したメンテナンス条件を参照し、メンテナンス条件を満たすときにメンテナンス可能と判定するものである。   As with the maintenance determination unit 51 in FIG. 1, the maintenance determination unit 53 refers to the maintenance condition stored in the maintenance condition storage unit 21 for the cache entry 3CE selected by the maintenance target selection unit 43 and satisfies the maintenance condition. It is determined that maintenance is possible.

キャッシュメンテナンス部63は、図1のキャッシュメンテナンス部61と同様に、メンテナンス対象選択部43が選択したキャッシュエントリについて、メンテナンス判定部53がメンテナンス可能と判定した場合、キャッシュエントリ3CEをメンテナンスするものである。   Similarly to the cache maintenance unit 61 in FIG. 1, the cache maintenance unit 63 maintains the cache entry 3CE when the maintenance determination unit 53 determines that maintenance is possible for the cache entry selected by the maintenance target selection unit 43. .

統計情報算出部73は、予め設定された統計期間における累積参照回数と、累積メンテナンス回数とを算出するものである。ここで、統計情報算出部73は、キャッシュメンテナンス装置3を統計期間運用して、累積参照回数及び累積メンテナンス回数を算出する。そして、統計情報算出部73は、この累積参照回数及び累積メンテナンス回数をキャッシュエントリ更新情報として、更新情報記憶部13に書き込む。   The statistical information calculation unit 73 calculates a cumulative reference count and a cumulative maintenance count in a preset statistical period. Here, the statistical information calculation unit 73 operates the cache maintenance device 3 for a statistical period, and calculates the cumulative reference count and the cumulative maintenance count. Then, the statistical information calculation unit 73 writes the cumulative reference count and the cumulative maintenance count as cache entry update information in the update information storage unit 13.

[キャッシュメンテナンス装置の動作]
キャッシュメンテナンス装置3は、図4と同じ全体動作を行うため、説明を省略する。以下、キャッシュメンテナンス装置3における、図4のステップS1の動作が異なるため、図15を参照し、これを説明する。
[Operation of the cache maintenance device]
The cache maintenance device 3 performs the same overall operation as in FIG. Hereinafter, since the operation of step S1 in FIG. 4 in the cache maintenance device 3 is different, this will be described with reference to FIG.

<ステップS1の詳細:メンテナンス条件の生成>
図15に示すように、キャッシュメンテナンス装置3は、統計情報算出部73によって、キャッシュエントリ統計情報を取得(算出)する(ステップS40)。そして、キャッシュメンテナンス装置3は、統計情報算出部73によって、このキャッシュエントリ統計情報を更新情報記憶部13に書き込む。なお、ステップS40の詳細は、後記する。
<Details of Step S1: Generation of Maintenance Conditions>
As shown in FIG. 15, the cache maintenance device 3 acquires (calculates) cache entry statistical information by the statistical information calculation unit 73 (step S40). Then, the cache maintenance device 3 writes the cache entry statistical information in the update information storage unit 13 by the statistical information calculation unit 73. Details of step S40 will be described later.

ステップS40の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、許容遅延回数及び許容遅延時間の少なくとも一方と、メンテナンスコストの目標負荷値とを取得(入力)する(ステップS41)。   Following the processing of step S40, the cache maintenance device 3 acquires (inputs) at least one of the allowable delay count and the allowable delay time and the target load value of the maintenance cost by the maintenance condition generation unit 33 (step S41). .

ステップS41の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、ステップS41で取得した目標負荷値に基づいて、削減目標値を算出する(ステップS42)。ここで、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、キャッシュエントリ統計情報を参照して、式(4)を用いて、削減目標値を算出する。なお、式(4)では、Dgは削減目標値、ΣMiは全てのキャッシュエントリの累積メンテナンス回数を示し、Gは目標負荷値を示す。
Dg=ΣMi×G/100・・・式(4)
Following the processing of step S41, the cache maintenance device 3 calculates a reduction target value based on the target load value acquired in step S41 by the maintenance condition generation unit 33 (step S42). Here, the cache maintenance device 3 uses the maintenance condition generation unit 33 to refer to the cache entry statistical information and calculate the reduction target value using Equation (4). In equation (4), Dg represents the reduction target value, ΣMi represents the cumulative maintenance count of all cache entries, and G represents the target load value.
Dg = ΣMi × G / 100 (4)

ステップS42の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、メンテナンス条件を生成していないキャッシュエントリ3CEから、1個のキャッシュエントリ3CEを選択する(ステップS43)。そして、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、選択した1個のキャッシュエントリ3CEを示すキャッシュエントリ識別子を出力する。なお、ステップS43の処理の詳細は、後記する。   Following the processing of step S42, the cache maintenance device 3 selects one cache entry 3CE from the cache entries 3CE that have not generated the maintenance condition by the maintenance condition generation unit 33 (step S43). Then, the cache maintenance device 3 outputs a cache entry identifier indicating one selected cache entry 3CE by the maintenance condition generation unit 33. Details of the processing in step S43 will be described later.

ステップS43の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、ステップS43で出力したキャッシュエントリ識別子に対応するキャッシュエントリ3CEについて、メンテナンス条件を生成すると共に、削減値を算出する(ステップS44)。ここで、ステップS41で許容遅延回数のみが入力された場合、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、式(1)を用いて削減値を算出し、式(5)で表されるメンテナンス条件を生成する。
A=Mi×(N−1)/N・・・式(1)
Mc>N ・・・式(5)
Following the processing in step S43, the cache maintenance device 3 generates maintenance conditions and calculates a reduction value for the cache entry 3CE corresponding to the cache entry identifier output in step S43 by the maintenance condition generation unit 33 ( Step S44). Here, when only the allowable number of delays is input in step S41, the cache maintenance device 3 calculates the reduction value using the formula (1) by the maintenance condition generation unit 33, and is expressed by the formula (5). Generate maintenance conditions.
A = Mi × (N−1) / N (1)
Mc> N (5)

また、ステップS41で許容遅延時間のみが入力された場合、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、式(2)を用いて削減値を算出し、式(6)で表されるメンテナンス条件を生成する。
A=Mi×(1−T/S)・・・式(2)
Pt>T ・・・式(6)
When only the allowable delay time is input in step S41, the cache maintenance device 3 calculates a reduction value using the equation (2) by the maintenance condition generation unit 33, and the maintenance represented by the equation (6). Generate a condition.
A = Mi × (1−T / S) (2)
Pt> T (6)

また、ステップS41で許容遅延回数と許容遅延時間との両方が入力された場合、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、式(3)を用いて削減値を算出し、式(7)で表されるメンテナンス条件を生成する。   When both the allowable delay count and the allowable delay time are input in step S41, the cache maintenance device 3 calculates a reduction value using the equation (3) by the maintenance condition generation unit 33, and the equation (7 ) Is generated.

A=MIN[{Mi×(N−1)/N},{Mi×(1−T/S)}]・・・式(3)
(Mc>N)OR(Pt>T) ・・・式(7)
A = MIN [{Mi × (N−1) / N}, {Mi × (1-T / S)}] (3)
(Mc> N) OR (Pt> T) (7)

但し、前記した式(1)〜式(3)において、Aは削減値、Miはメンテナンス回数の累積値、Nは許容遅延回数、Tは許容遅延時間、及び、Sは統計期間である。また、前記した式(5)〜式(7)において、Mcはメンテナンスカウントを示し、Ptは経過時間を示し、ORはOR条件を示し、MINは最小値を出力する関数である。   In Equations (1) to (3), A is a reduction value, Mi is a cumulative value of the number of maintenance times, N is an allowable delay number, T is an allowable delay time, and S is a statistical period. Further, in the above formulas (5) to (7), Mc represents a maintenance count, Pt represents an elapsed time, OR represents an OR condition, and MIN is a function that outputs a minimum value.

また、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、メンテナンス条件を生成する毎に、削減目標値(Dg)から削減値(A)を減算する。そして、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、減算後の削減目標値を出力する。   Further, the cache maintenance device 3 subtracts the reduction value (A) from the reduction target value (Dg) every time the maintenance condition is generated by the maintenance condition generation unit 33. Then, the cache maintenance device 3 outputs the reduction target value after the subtraction by the maintenance condition generation unit 33.

ステップS44の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、目標負荷を達成したか、又は、全てのキャッシュエントリ3CEのメンテナンス条件を生成した否かを判定する(ステップS45)。ここで、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、ステップS44で出力した減算後の削減目標値が0以下の値となった場合、目標負荷を達成したと判定する。   Following the processing in step S44, the cache maintenance device 3 determines whether the maintenance condition generation unit 33 has achieved the target load or whether the maintenance conditions for all the cache entries 3CE have been generated (step S45). . Here, the cache maintenance device 3 determines that the target load has been achieved when the maintenance condition generation unit 33 causes the reduction target value after subtraction output in step S44 to be 0 or less.

ここで、目標負荷を達成したか、又は、全てのキャッシュエントリ3CEのメンテナンス条件を生成したと判定した場合(ステップ45でYes)、キャッシュメンテナンス装置3は、ステップS46の処理に進む。目標負荷を達成せず、かつ、全てのキャッシュエントリ3CEのメンテナンス条件を生成していないと判定した場合(ステップ45でNo)、キャッシュメンテナンス装置3は、ステップS43の処理に戻る。   If it is determined that the target load has been achieved or the maintenance conditions for all the cache entries 3CE have been generated (Yes in step 45), the cache maintenance device 3 proceeds to the process of step S46. When it is determined that the target load has not been achieved and the maintenance conditions for all the cache entries 3CE have not been generated (No in step 45), the cache maintenance device 3 returns to the process of step S43.

ステップS45の処理に続いて、キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、メンテナンス条件を生成していないキャッシュエントリ3CEが存在する場合、このキャッシュエントリ3CEについて、式(8)で表されるメンテナンス条件を生成する(ステップS46)。なお、式(8)は、データベース3Bのデータと、これに対応するキャッシュエントリ3CEとの間に不整合が発生した場合、目標負荷に関係なく、常にメンテナンスを行うことを示す。
Mc>1・・・式(8)
Following the processing of step S45, when there is a cache entry 3CE for which no maintenance condition has been generated by the maintenance condition generating unit 33, the cache maintenance device 3 is expressed by equation (8) for the cache entry 3CE. Maintenance conditions are generated (step S46). Equation (8) indicates that when a mismatch occurs between the data in the database 3B and the corresponding cache entry 3CE, maintenance is always performed regardless of the target load.
Mc> 1 Formula (8)

<ステップS40の詳細:キャッシュエントリ統計情報の取得>
以下、図16を参照して、図15のステップS40(キャッシュエントリ統計情報の取得)の詳細について説明する。まず、キャッシュメンテナンス装置3は、統計情報算出部73によって、設定ファイルから統計期間を読み取り、又は、入力部によって統計期間が入力される(ステップS401)。
<Details of Step S40: Acquisition of Cache Entry Statistics Information>
Hereinafter, the details of step S40 (acquisition of cache entry statistical information) in FIG. 15 will be described with reference to FIG. First, the cache maintenance device 3 reads the statistical period from the setting file by the statistical information calculation unit 73 or inputs the statistical period by the input unit (step S401).

ステップS401の処理に続いて、キャッシュメンテナンス装置3は、統計情報算出部73によって、ステップS401で入力された統計期間における、参照回数及びメンテナンス回数を算出し、キャッシュエントリ統計情報に書き込む(ステップS402)。このメンテナンス回数は、無効化方式では無効化メッセージ、再問い合わせ方式及び差分更新方式ではキャッシュエントリ3CEへの書き込みリクエストの回数である。   Subsequent to the processing in step S401, the cache maintenance device 3 calculates the reference count and the maintenance count in the statistical period input in step S401 by the statistical information calculation unit 73, and writes it in the cache entry statistical information (step S402). . The number of maintenance times is the number of write requests to the cache entry 3CE in the invalidation method, and in the re-inquiry method and the differential update method.

ステップS402の処理に続いて、キャッシュメンテナンス装置3は、統計情報算出部73によって、ステップS401で入力された統計期間が終了したか否かを判定する(ステップS403)。ここで、統計期間が終了したと判定した場合(ステップ403でYes)、キャッシュメンテナンス装置3は、処理を終了する。一方、統計期間が終了していないと判定した場合(ステップ403でNo)、キャッシュメンテナンス装置3は、ステップS402の処理に戻る。   Following the processing of step S402, the cache maintenance device 3 determines whether or not the statistical period input in step S401 has ended by the statistical information calculation unit 73 (step S403). If it is determined that the statistical period has ended (Yes in step 403), the cache maintenance device 3 ends the process. On the other hand, when it is determined that the statistical period has not ended (No in step 403), the cache maintenance device 3 returns to the process of step S402.

<ステップS43の詳細:キャッシュエントリの選択:第1例>
以下、図17を参照して、図15のステップS43(キャッシュエントリの選択)の第1例について説明する。キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、メンテナンス条件を生成しておらず、かつ、メンテナンス回数の累積値が最大となるキャッシュエントリ3CEを選択する(ステップS431)。
<Details of Step S43: Selection of Cache Entry: First Example>
Hereinafter, a first example of step S43 (selection of cache entry) in FIG. 15 will be described with reference to FIG. In the cache maintenance device 3, the maintenance condition generator 33 selects a cache entry 3CE that has not generated a maintenance condition and has the maximum accumulated maintenance count (step S431).

これによって、キャッシュメンテナンス装置3は、メンテナンスの頻度が高いキャッシュ程、メンテナンスの頻度を削減による効果(例えば、無効化方式を採用したときはキャッシュヒット率の向上、再問い合わせ方式を採用したときは処理負荷の削減)が大きくなる。従って、キャッシュメンテナンス装置3は、メンテナンス条件を設定してメンテナンスを行うキャッシュの数を必要最小限とし、キャッシュの最新性の低下を最小限に抑える。   As a result, the cache maintenance device 3 can improve the cache hit rate with the higher maintenance frequency (for example, the cache hit rate is improved when the invalidation method is used, and the processing is performed when the requery method is used). Load reduction). Therefore, the cache maintenance device 3 sets the maintenance conditions and minimizes the number of caches to be maintained, thereby minimizing the deterioration of cache freshness.

<ステップS43の詳細:キャッシュエントリの選択:第2例>
以下、図18を参照して、図15のステップS43(キャッシュエントリの選択)の第2例について説明する。キャッシュメンテナンス装置3は、メンテナンス条件生成部33によって、メンテナンス条件生成部33がメンテナンス条件を生成しておらず、かつ、参照回数の累積値が最小となるキャッシュエントリ3CEを選択する(ステップS432)。
<Details of Step S43: Selection of Cache Entry: Second Example>
Hereinafter, a second example of step S43 (selection of cache entry) in FIG. 15 will be described with reference to FIG. In the cache maintenance device 3, the maintenance condition generation unit 33 selects the cache entry 3CE in which the maintenance condition generation unit 33 has not generated the maintenance condition and the cumulative value of the reference count is the minimum (step S432).

これによって、キャッシュメンテナンス装置3は、メンテナンスによる悪影響が少ないキャッシュから順にメンテナンスを行うことで、キャッシュの最新性の低下を最小限に抑える。   As a result, the cache maintenance device 3 performs maintenance in order from the cache having the least adverse effect of the maintenance, thereby minimizing the deterioration of the cache freshness.

以上のように、第3実施形態に係るキャッシュメンテナンス装置3は、メンテナンス条件を満たす場合にのみ、キャッシュエントリ3CEのメンテナンスを行うため、データベース3Bに高い頻度で更新処理が行われる環境においても、参照速度が低下せず、処理負荷の増大を最小限に抑えることができる。また、キャッシュメンテナンス装置3は、無効化方式を採用したときは、メンテナンスによってキャッシュが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。さらに、キャッシュメンテナンス装置3は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。さらに、キャッシュメンテナンス装置3は、目標負荷を達成した後、不要なメンテナンスを行うことがなく、処理負荷をさらに削減できる。   As described above, the cache maintenance device 3 according to the third embodiment performs maintenance of the cache entry 3CE only when the maintenance condition is satisfied. Therefore, even in an environment where update processing is frequently performed on the database 3B. The speed does not decrease, and the increase in processing load can be minimized. Further, when the cache maintenance device 3 adopts the invalidation method, the frequency of cache invalidation due to maintenance is reduced, so that the cache hit rate is greatly improved. Furthermore, when the re-inquiry method is adopted, the cache maintenance device 3 can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance. . Furthermore, after achieving the target load, the cache maintenance device 3 can further reduce the processing load without performing unnecessary maintenance.

(第4実施形態:無効化方式又は再問い合わせ方式)
[キャッシュメンテナンス装置の構成]
以下、図19を参照して、第4実施形態に係るキャッシュメンテナンス装置4の構成について、第1実施形態と異なる点を主に説明する。キャッシュメンテナンス装置4は、データベースの負荷情報をメンテナンス条件に反映させる点が、キャッシュメンテナンス装置1と大きく相違する。
(Fourth embodiment: invalidation method or re-inquiry method)
[Configuration of cache maintenance device]
Hereinafter, the configuration of the cache maintenance device 4 according to the fourth embodiment will be described mainly with respect to differences from the first embodiment with reference to FIG. The cache maintenance device 4 is greatly different from the cache maintenance device 1 in that the load information of the database is reflected in the maintenance conditions.

このため、図19に示すように、キャッシュメンテナンス装置4は、更新情報記憶部14と、メンテナンス条件記憶部24と、メンテナンス条件生成部34と、メンテナンス対象選択部44と、メンテナンス判定部54と、キャッシュメンテナンス部64と、データベース負荷測定部84とを備える。   For this reason, as shown in FIG. 19, the cache maintenance device 4 includes an update information storage unit 14, a maintenance condition storage unit 24, a maintenance condition generation unit 34, a maintenance target selection unit 44, a maintenance determination unit 54, A cache maintenance unit 64 and a database load measurement unit 84 are provided.

メンテナンス条件記憶部24は、メンテナンス条件を記憶するハードディスク等の記憶手段である。ここでは、図20に示すように、メンテナンス条件は、後記する負荷条件が所定の閾値を超えるといった条件が付加される。なお、設定ファイルから負荷条件を読み取り、又は、入力部によって負荷条件が入力される。   The maintenance condition storage unit 24 is a storage unit such as a hard disk that stores maintenance conditions. Here, as shown in FIG. 20, the maintenance condition is added such that a load condition described later exceeds a predetermined threshold value. The load condition is read from the setting file, or the load condition is input by the input unit.

図19のメンテナンス条件生成部34は、図1のメンテナンス条件生成部33と同様に、メンテナンス条件を生成してメンテナンス条件記憶部24に書き込むものである。このとき、メンテナンス条件生成部34は、このメンテナンス条件に、後記するデータベース負荷測定部80が測定した負荷値が負荷条件を満たすという条件を付加する。例えば、メンテナンス条件生成部34は、メンテナンス条件が「メンテナンスカウント>10回」の場合、「(メンテナンスカウント>10回)AND(CPU使用率>90%)」というような負荷条件をAND条件で付加する。   The maintenance condition generation unit 34 in FIG. 19 generates maintenance conditions and writes them in the maintenance condition storage unit 24 in the same manner as the maintenance condition generation unit 33 in FIG. At this time, the maintenance condition generating unit 34 adds a condition that the load value measured by the database load measuring unit 80 described later satisfies the load condition to the maintenance condition. For example, when the maintenance condition is “maintenance count> 10 times”, the maintenance condition generation unit 34 adds a load condition such as “(maintenance count> 10 times) AND (CPU usage rate> 90%)” under the AND condition. To do.

データベース負荷測定部84は、データベース4Bの負荷を示す負荷値を測定するものである。ここで、データベース負荷測定部84は、データベース4Bを有するサーバのCPU使用率、インターフェース使用率、メモリ使用率、ディスクI/O値等の負荷値を測定する。なお、負荷条件とは、負荷値が予め設定された閾値以上又は負荷値がこの閾値以下であるといった条件を示す。   The database load measuring unit 84 measures a load value indicating the load of the database 4B. Here, the database load measurement unit 84 measures load values such as a CPU usage rate, an interface usage rate, a memory usage rate, and a disk I / O value of the server having the database 4B. The load condition indicates a condition that the load value is equal to or greater than a preset threshold value or the load value is equal to or less than this threshold value.

なお、更新情報記憶部14は、メンテナンス対象選択部44は、メンテナンス判定部54及びキャッシュメンテナンス部64は、図1の各手段と同様のものであるため、説明を省略する。   The update information storage unit 14, the maintenance target selection unit 44, the maintenance determination unit 54, and the cache maintenance unit 64 are the same as the respective units in FIG.

[キャッシュメンテナンス装置の動作]
<ステップS1の詳細:メンテナンス条件の生成>
キャッシュメンテナンス装置4は、図4と同じ全体動作を行うため、説明を省略する。以下、キャッシュメンテナンス装置4における、図4のステップS1の動作が異なるため、図21を参照し、これを説明する。
[Operation of the cache maintenance device]
<Details of Step S1: Generation of Maintenance Conditions>
The cache maintenance device 4 performs the same overall operation as in FIG. Hereinafter, since the operation of step S1 in FIG. 4 in the cache maintenance device 4 is different, this will be described with reference to FIG.

まず、キャッシュメンテナンス装置4は、メンテナンス条件生成部34によって、許容遅延回数及び許容遅延時間の少なくとも一方を取得(入力)する(ステップS50)。また、キャッシュメンテナンス装置4は、メンテナンス条件生成部34によって、メンテナンス条件を生成する(ステップS51)。そして、キャッシュメンテナンス装置4は、メンテナンス条件生成部34によって、メンテナンス条件に負荷条件をAND条件で付加する(ステップS52)。   First, the cache maintenance device 4 acquires (inputs) at least one of the allowable delay number and the allowable delay time by the maintenance condition generation unit 34 (step S50). Further, the cache maintenance device 4 generates a maintenance condition by the maintenance condition generation unit 34 (step S51). Then, the cache maintenance device 4 adds the load condition to the maintenance condition as an AND condition by the maintenance condition generation unit 34 (step S52).

<ステップS23の詳細:メンテナンス条件の評価>
以下、キャッシュメンテナンス装置4における、図5のステップS23の動作が異なるため、図21を参照し、これを説明する。まず、キャッシュメンテナンス装置4は、メンテナンス判定部54によって、メンテナンス対象となるキャッシュエントリ4CEについて、メンテナンス条件記憶部24を参照してメンテナンス条件を取得し、更新情報記憶部14を参照してキャッシュエントリ更新情報を取得する(ステップS60)。
<Details of Step S23: Evaluation of Maintenance Conditions>
Hereinafter, since the operation of step S23 in FIG. 5 in the cache maintenance device 4 is different, this will be described with reference to FIG. First, the cache maintenance device 4 uses the maintenance determination unit 54 to acquire maintenance conditions for the cache entry 4CE to be maintained with reference to the maintenance condition storage unit 24, and updates the cache entry with reference to the update information storage unit 14 Information is acquired (step S60).

ステップS60の処理に続いて、キャッシュメンテナンス装置4は、データベース負荷測定部84によって、負荷値を測定する(ステップS61)。   Following the processing of step S60, the cache maintenance device 4 measures the load value by the database load measuring unit 84 (step S61).

ステップS61の処理に続いて、キャッシュメンテナンス装置4は、メンテナンス判定部54によって、ステップS60で取得したメンテナンス条件に、ステップS61で取得したキャッシュエントリ更新情報とステップS62で測定した負荷値とを代入してメンテナンス条件を評価し、この評価結果に応じた真偽値を出力する(ステップS62)。   Following the processing of step S61, the cache maintenance device 4 uses the maintenance determination unit 54 to substitute the cache entry update information acquired in step S61 and the load value measured in step S62 for the maintenance condition acquired in step S60. The maintenance condition is evaluated, and a true / false value corresponding to the evaluation result is output (step S62).

以上のように、第4実施形態に係るキャッシュメンテナンス装置4は、メンテナンス条件を満たす場合にのみキャッシュエントリ4CEのメンテナンスを行い、メンテナンスの頻度を制御することとした。これによって、キャッシュメンテナンス装置4は、無効化方式を採用したときは、メンテナンスによってキャッシュが無効化される頻度が低減するので、キャッシュヒット率が大幅に向上する。また、キャッシュメンテナンス装置4は、再問い合わせ方式を採用したときは、メンテナンス条件の判定の処理負荷がメンテナンスの頻度を少なくして削減できるメンテナンスコストよりも十分に小さいため、メンテナンスコストを大幅に削減できる。さらに、キャッシュメンテナンス装置4は、負荷条件を設定することで、データベースの負荷に応じて、メンテナンスの頻度を制御することができる。これによって、キャッシュメンテナンス装置4は、例えば、データベースサーバのCPU資源に余裕があるときにメンテナンスの頻度を低下させてCPU資源を節約するといった事態を防止し、データベース4Bにパフォーマンスを十分に発揮させることができる。   As described above, the cache maintenance device 4 according to the fourth embodiment performs maintenance of the cache entry 4CE only when the maintenance condition is satisfied, and controls the maintenance frequency. As a result, when the cache maintenance device 4 adopts the invalidation method, the frequency of cache invalidation due to maintenance is reduced, so that the cache hit rate is greatly improved. In addition, when the re-inquiry method is adopted, the cache maintenance device 4 can significantly reduce the maintenance cost because the processing load for determining the maintenance condition is sufficiently smaller than the maintenance cost that can be reduced by reducing the frequency of maintenance. . Furthermore, the cache maintenance device 4 can control the frequency of maintenance according to the load of the database by setting the load condition. As a result, the cache maintenance device 4 prevents, for example, a situation in which the CPU frequency of the database server is low and the CPU frequency is saved by reducing the frequency of maintenance, and allows the database 4B to perform sufficiently. Can do.

なお、キャッシュメンテナンス装置4は、第1実施形態と同様の手法でメンテナンス条件を設定することとして説明したが、これに限定されない。キャッシュメンテナンス装置4は、第3実施形態と同様に、目標負荷を達成するまで、負荷条件が負荷されたメンテナンス条件を生成することとしても良い。この場合、キャッシュメンテナンス装置4は、メンテナンス回数が大きい順に、又は、参照回数が小さい順にメンテナンス条件を生成することとしても良い。   Although the cache maintenance device 4 has been described as setting maintenance conditions by the same method as in the first embodiment, the present invention is not limited to this. Similarly to the third embodiment, the cache maintenance device 4 may generate maintenance conditions loaded with load conditions until the target load is achieved. In this case, the cache maintenance device 4 may generate the maintenance conditions in the descending order of the maintenance frequency or in ascending order of the reference frequency.

以下、本発明の実施例について説明する(適宜図8,図9参照)。ここでは、図8で示したキャッシュメンテナンスシステム200を以下の環境で実装し、このときのキャッシュメンテナンス装置2の検証結果を示して説明する。   Examples of the present invention will be described below (see FIGS. 8 and 9 as appropriate). Here, the cache maintenance system 200 shown in FIG. 8 is mounted in the following environment, and the verification result of the cache maintenance device 2 at this time is shown and described.

本実施では、アプリケーションサーバは、下記のサーバ1台で構成した。
CPU :Xeon(登録商標) X5470 3.3GHz×1
メモリ :32Gバイト
ハードディスク :1.5Tバイト(RAID10)
ミドルウェア :ruby1.8.5,MySQL5.0
In this embodiment, the application server is configured by one server described below.
CPU: Xeon (registered trademark) X5470 3.3 GHz × 1
Memory: 32GB Hard disk: 1.5TB (RAID10)
Middleware: ruby 1.8.5, MySQL5.0

また、本実施では、データベースサーバ2Bは、下記のサーバ1台で構成した。
CPU :Xeon(登録商標) X5355 2.66GHz×2
メモリ :16Gバイト
ハードディスク :1.5Tバイト(RAID10)
ミドルウェア :MySQL5.0,libmemcached0.23
In this embodiment, the database server 2B is composed of one server as described below.
CPU: Xeon (registered trademark) X5355 2.66 GHz × 2
Memory: 16 Gbytes Hard disk: 1.5 Tbytes (RAID10)
Middleware: MySQL5.0, libmcached0.23

また、本実施では、キャッシュ2Cは、下記のサーバ10台で構成した。
CPU :Celeron(登録商標) X430 1.8GHz×1
メモリ :2Gバイト
ハードディスク :500Gバイト
ミドルウェア :memcached1.2.6
In this embodiment, the cache 2C is composed of the following 10 servers.
CPU: Celeron (registered trademark) X430 1.8 GHz × 1
Memory: 2 GB Hard disk: 500 GB Middleware: memcached 1.2.6

また、本実施では、ミニブログサービスである「gooひとこと」を対象としてクローリングを行い、ユーザ同士の友好関係の情報(「follower」テーブル)と、各ユーザが投稿したメッセージの情報(「message」テーブル)とを取得し、これらをサンプルデータとしてデータベース2Bに格納した。このサンプルデータの詳細を下記に示す。
「message」テーブル :1128300件
「follower」テーブル:70803件
有効ユーザ数 :16596人
対象期間 :2008年5月〜11月
Also, in this embodiment, crawling is performed for the “blog” that is a mini blog service, information on friendship between users (“follower” table), and information on messages posted by each user (“message” table) ) And stored as sample data in the database 2B. Details of this sample data are shown below.
“Message” table: 1128300 “follower” table: 70803 Effective number of users: 16596 Target period: May to November 2008

そして、前記したデータの一部をデータベース2Bに登録(INSERT)する問い合わせを、2分間、高負荷となるように行い、このときの更新スループットの限界値を測定した。なお、許容遅延回数を10回に設定したものを実施例1とする。また、同一条件にて、従来技術(常時メンテナンス方式)による更新スループットの限界値も合わせて測定した。これを比較例1とする。   Then, an inquiry for registering (INSERT) a part of the above-described data in the database 2B was performed at a high load for 2 minutes, and the limit value of the update throughput at this time was measured. A case where the allowable number of delays is set to 10 is referred to as Example 1. In addition, under the same conditions, the limit value of the update throughput according to the conventional technique (always maintenance method) was also measured. This is referred to as Comparative Example 1.

以下に、実施例1,2及び比較例1の更新スループットの限界値を示す。なお、この更新スループットの限界値は、数値が高いほど、メンテナンスコストが小さいことを示す。
実施例1:213.4件/秒
比較例1: 89.6件/秒
The limit values of the update throughput of Examples 1 and 2 and Comparative Example 1 are shown below. The limit value of the update throughput indicates that the higher the numerical value, the lower the maintenance cost.
Example 1: 213.4 cases / second Comparative Example 1: 89.6 cases / second

前記した測定結果から、比較例1での更新スループットの限界値が89.6件/秒であるのに対し、実施例1の更新スループットの限界値は213.4件/秒となっており、更新スループットの限界値が向上してメンテナンスコストが低減されていることがわかる。   From the above measurement results, the limit value of the update throughput in Comparative Example 1 is 89.6 cases / second, whereas the limit value of the update throughput of Example 1 is 213.4 cases / second, It can be seen that the limit value of the update throughput is improved and the maintenance cost is reduced.

また、キャッシュメンテナンスシステム200において、許容遅延回数を徐々に増加させたものを実施例2として説明する。そして、実施例2における許容遅延回数と更新スループットの限界値との関係を測定し、この結果を図23に示す。なお、図23では、横軸が許容遅延回数であり、縦軸が更新スループットの限界値である。   In the cache maintenance system 200, an example in which the number of allowable delays is gradually increased will be described as a second embodiment. Then, the relationship between the allowable number of delays and the update throughput limit in Example 2 was measured, and the result is shown in FIG. In FIG. 23, the horizontal axis represents the allowable number of delays, and the vertical axis represents the update throughput limit value.

図23の結果から、実施例2では、許容遅延回数を増加させる程、更新スループットの限界値が向上することがわかる。ここで、比較例1と対して、実施例2は、更新スループットの限界値が最大で27倍となる。つまり、本発明に係るキャッシュメンテナンス装置2は、許容遅延回数を多くする程、メンテナンスコストを低減できることがわかる。   From the results of FIG. 23, it can be seen that in Example 2, the limit value of the update throughput is improved as the allowable number of delays is increased. Here, in comparison with Comparative Example 1, in Example 2, the limit value of the update throughput is 27 times at the maximum. That is, it can be seen that the cache maintenance device 2 according to the present invention can reduce the maintenance cost as the allowable number of delays is increased.

なお、図23において、許容遅延回数が1回の場合(図23の左端)、実施例2が、比較例1と略同等の測定結果となる点について補足する。実施例2では、許容遅延回数が1回の場合、比較例1と同じ頻度でメンテナンスを行うことになるのに加え、メンテナンス判定のコストが別途発生する。このため、図23の左端に示すように、実施例2と比較例1との測定結果が略同等になると考えられる。   In FIG. 23, when the allowable number of delays is 1 (the left end of FIG. 23), a supplementary explanation will be made on the point that Example 2 gives a measurement result substantially equivalent to Comparative Example 1. In the second embodiment, when the allowable number of delays is one, maintenance is performed at the same frequency as in the first comparative example, and in addition, a maintenance determination cost is additionally generated. For this reason, as shown in the left end of FIG. 23, it is thought that the measurement result of Example 2 and Comparative Example 1 becomes substantially equivalent.

・ キャッシュメンテナンス装置
1B,2B,3B,4B データベース
1C,2C,3C,4C キャッシュ
1CE,2CE,3CE,4CE キャッシュエントリ
11,13,14 更新情報記憶部
21,22,23,24 メンテナンス条件記憶部
31,32,33,34 メンテナンス条件生成部
41,43,44 メンテナンス対象選択部
51,52,53,54 メンテナンス判定部
61,63,64 キャッシュメンテナンス部
62 キャッシュ差分メンテナンス部(キャッシュメンテナンス部)
73 統計情報算出部
84 データベース負荷測定部
100,200,300,400 キャッシュメンテナンスシステム
Cache maintenance device 1B, 2B, 3B, 4B Database 1C, 2C, 3C, 4C Cache 1CE, 2CE, 3CE, 4CE Cache entries 11, 13, 14 Update information storage unit 21, 22, 23, 24 Maintenance condition storage unit 31 , 32, 33, 34 Maintenance condition generation units 41, 43, 44 Maintenance target selection units 51, 52, 53, 54 Maintenance determination units 61, 63, 64 Cache maintenance unit 62 Cache difference maintenance unit (cache maintenance unit)
73 Statistical information calculation unit 84 Database load measurement unit 100, 200, 300, 400 Cache maintenance system

Claims (9)

1以上のコンピュータのメモリで構成されるキャッシュにデータベースからのデータを保存する分散メモリキャッシュにおける、前記データを前記キャッシュに保存する単位となるキャッシュエントリをメンテナンスするキャッシュメンテナンス装置において、
前記キャッシュエントリをメンテナンスする条件であるメンテナンス条件を記憶するメンテナンス条件記憶部と、
前記メンテナンス条件記憶部に記憶したメンテナンス条件を参照し、前記メンテナンス条件を満たすときにメンテナンス可能と判定するメンテナンス判定部と、
前記メンテナンス判定部がメンテナンス可能と判定した場合、前記キャッシュエントリをメンテナンスするキャッシュメンテナンス部と、
を備えることを特徴とするキャッシュメンテナンス装置。
In a cache maintenance device for maintaining a cache entry as a unit for storing the data in the cache in a distributed memory cache that stores data from a database in a cache constituted by one or more computer memories,
A maintenance condition storage unit that stores a maintenance condition that is a condition for maintaining the cache entry;
A maintenance determination unit that refers to the maintenance condition stored in the maintenance condition storage unit and determines that maintenance is possible when the maintenance condition is satisfied;
A cache maintenance unit that maintains the cache entry when the maintenance determination unit determines that maintenance is possible;
A cache maintenance device comprising:
前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、
予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、をさらに備え、
前記メンテナンス条件生成部は、
前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成することを特徴とする請求項1に記載のキャッシュメンテナンス装置。
An update information storage unit that stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time;
A maintenance condition generation unit that receives at least one of a preset allowable delay number and an allowable delay time, generates the maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit; and
The maintenance condition generation unit
When only the allowable delay count is input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count is generated,
When only the allowable delay time is input, the maintenance condition that enables the maintenance when the elapsed time indicating the previous maintenance time to the current time exceeds the allowable delay time is generated,
When the allowable delay count and the allowable delay time are input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count or when the elapsed time exceeds the allowable delay time The cache maintenance device according to claim 1, wherein:
予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部、をさらに備え、
前記メンテナンス条件生成部は、
前記許容遅延回数のみが入力された場合、更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延時間のみが入力された場合、経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記メンテナンス判定部は、
前記データベースのテーブルにおける差分データを格納した差分テーブルを参照し、当該差分テーブルのデータ件数を前記更新回数として算出すると共に、当該差分テーブルにおける最も古いデータを格納した時刻から現在時刻までを前記経過時間として算出し、算出した前記更新回数と前記経過時間とを用いて前記メンテナンス条件を満たすか判定し、
前記キャッシュメンテナンス部は、
前記差分テーブルに格納した前記差分データで前記キャッシュエントリを一括して更新すると共に、更新した前記差分データを前記差分テーブルから削除することを特徴とする請求項1に記載のキャッシュメンテナンス装置。
A maintenance condition generation unit that receives at least one of a preset allowable delay number and an allowable delay time, generates the maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit;
The maintenance condition generation unit
When only the allowable delay count is input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count is generated,
When only the allowable delay time is input, the maintenance condition that enables the maintenance when an elapsed time exceeds the allowable delay time is generated,
When the allowable delay count and the allowable delay time are input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count or when the elapsed time exceeds the allowable delay time Produces
The maintenance determination unit
The difference table storing the difference data in the database table is referred to, the number of data items in the difference table is calculated as the update count, and the elapsed time from the time when the oldest data is stored in the difference table to the current time is calculated. To determine whether the maintenance condition is satisfied using the calculated number of updates and the elapsed time,
The cache maintenance unit
The cache maintenance device according to claim 1, wherein the cache entry is updated collectively with the difference data stored in the difference table, and the updated difference data is deleted from the difference table.
前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、
予め設定された許容遅延回数及び許容遅延時間の少なくとも一方と、メンテナンスコストの目標負荷値とが入力され、当該入力に基づいて、前記キャッシュエントリ毎に前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、
予め設定された統計期間における前記キャッシュエントリをメンテナンスした回数を示すメンテナンス回数の累積値を統計情報として算出する統計情報算出部と、をさらに備え、
前記メンテナンス条件生成部は、
前記メンテナンス回数の累積値に前記目標負荷値を乗じて削減目標値を算出し、
前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(1)で算出した削減値を前記削減目標値から減算し、
前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(2)で算出した削減値を前記削減目標値から減算し、
前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超えたとき又は前記経過時間が前記許容遅延時間を超えたときに前記メンテナンス可能となる前記メンテナンス条件を生成し、式(3)で算出した削減値を前記削減目標値から減算し、
前記削減目標値から前記削減値を減算した値が0以下になったときは、前記メンテナンス条件の生成を終了することを特徴とする請求項1に記載のキャッシュメンテナンス装置。
A=Mi×(N−1)/N・・・式(1)
A=Mi×(1−T/S)・・・式(2)
A=MIN[{Mi×(N−1)/N},{Mi×(1−T/S)}]・・・式(3)
但し、式(1)〜式(3)において、Aは削減値、Miはメンテナンス回数の累積値、Nは許容遅延回数、Tは許容遅延時間、及び、Sは統計期間である。
An update information storage unit that stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time;
At least one of an allowable delay number and an allowable delay time set in advance and a target load value of maintenance cost are input, and based on the input, the maintenance condition is generated for each cache entry, and the maintenance condition storage unit A maintenance condition generation unit to write to,
A statistical information calculation unit that calculates, as statistical information, a cumulative value of maintenance counts indicating the number of times that the cache entry has been maintained in a preset statistical period;
The maintenance condition generation unit
Multiplying the cumulative value of the maintenance times by the target load value to calculate a reduction target value,
When only the allowable delay count is input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count is generated, and the reduction value calculated by Expression (1) is set as the reduction target value. Subtract from
When only the allowable delay time is input, the maintenance condition that enables the maintenance when the elapsed time from the previous maintenance time to the current time exceeds the allowable delay time is generated, and Expression (2) Subtract the reduction value calculated in step 1 from the reduction target value,
When the allowable delay count and the allowable delay time are input, the maintenance condition that enables the maintenance when the update count exceeds the allowable delay count or when the elapsed time exceeds the allowable delay time And subtracting the reduction value calculated by Equation (3) from the reduction target value,
2. The cache maintenance device according to claim 1, wherein when the value obtained by subtracting the reduction value from the reduction target value becomes 0 or less, the generation of the maintenance condition is terminated.
A = Mi × (N−1) / N (1)
A = Mi × (1−T / S) (2)
A = MIN [{Mi × (N−1) / N}, {Mi × (1-T / S)}] (3)
In Equations (1) to (3), A is a reduction value, Mi is a cumulative value of the number of maintenance times, N is an allowable delay number, T is an allowable delay time, and S is a statistical period.
前記メンテナンス条件生成部は、前記メンテナンス条件を生成しておらず、かつ、前記メンテナンス回数の累積値が最大となる前記キャッシュエントリについて、前記メンテナンス条件を生成することを特徴とする請求項4に記載のキャッシュメンテナンス装置。   5. The maintenance condition generation unit according to claim 4, wherein the maintenance condition generation unit generates the maintenance condition for the cache entry in which the maintenance condition is not generated and the cumulative value of the number of maintenance times is maximized. Cash maintenance equipment. 前記統計情報算出部は、前記統計情報として、前記統計期間における前記キャッシュエントリが参照された参照回数の累積値を算出し、
前記メンテナンス条件生成部は、前記メンテナンス条件を生成しておらず、かつ、前記参照回数の累積値が最小となる前記キャッシュエントリについて、前記メンテナンス条件を生成することを特徴とする請求項4に記載のキャッシュメンテナンス装置。
The statistical information calculation unit calculates, as the statistical information, a cumulative value of the number of times the cache entry is referenced in the statistical period,
5. The maintenance condition generation unit according to claim 4, wherein the maintenance condition generation unit generates the maintenance condition for the cache entry in which the maintenance condition is not generated and the cumulative value of the reference count is minimized. Cash maintenance equipment.
前回のメンテナンス時刻、及び、前回の前記メンテナンス時刻以後に前記データが更新された回数を示す更新回数の少なくとも一方を含む更新情報を記憶する更新情報記憶部と、
予め設定された許容遅延回数及び許容遅延時間の少なくとも一方が入力され、当該入力に基づいて、前記メンテナンス条件を生成して前記メンテナンス条件記憶部に書き込むメンテナンス条件生成部と、
前記データベースの負荷を示す負荷値を測定するデータベース負荷測定部と、をさらに備え、
前記メンテナンス条件生成部は、
前記許容遅延回数のみが入力された場合、前記更新回数が前記許容遅延回数を超え、かつ、前記負荷値が予め設定された負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延時間のみが入力された場合、前回の前記メンテナンス時刻から現在時刻までを示す経過時間が前記許容遅延時間を超え、かつ、前記負荷値が前記負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成し、
前記許容遅延回数と前記許容遅延時間とが入力された場合、前記更新回数が前記許容遅延回数を超え又は前記経過時間が前記許容遅延時間を超え、かつ、前記負荷値が前記負荷条件を満たすときに前記メンテナンス可能となる前記メンテナンス条件を生成することを特徴とする請求項1に記載のキャッシュメンテナンス装置。
An update information storage unit that stores update information including at least one of a previous maintenance time and an update count indicating the number of times the data has been updated since the previous maintenance time;
A maintenance condition generation unit that receives at least one of a preset allowable delay number and an allowable delay time, generates the maintenance condition based on the input, and writes the maintenance condition in the maintenance condition storage unit;
A database load measuring unit that measures a load value indicating the load of the database, and
The maintenance condition generation unit
When only the allowable delay number is input, the maintenance condition that enables the maintenance when the update number exceeds the allowable delay number and the load value satisfies a preset load condition is generated,
When only the allowable delay time is input, the maintenance is possible when the elapsed time from the previous maintenance time to the current time exceeds the allowable delay time and the load value satisfies the load condition. Generating the maintenance condition;
When the allowable delay count and the allowable delay time are input, the update count exceeds the allowable delay count or the elapsed time exceeds the allowable delay time, and the load value satisfies the load condition The cache maintenance apparatus according to claim 1, wherein the maintenance condition that enables the maintenance is generated.
1以上のコンピュータのメモリで構成されるキャッシュにデータベースからのデータを保存する分散メモリキャッシュにおける、前記データを前記キャッシュに保存する単位となるキャッシュエントリをメンテナンスするキャッシュメンテナンス方法において、
前記キャッシュエントリをメンテナンスする条件であるメンテナンス条件を参照し、前記メンテナンス条件を満たすときにメンテナンス可能と判定するメンテナンス判定ステップと、
前記メンテナンス判定ステップでメンテナンス可能と判定した場合、前記キャッシュエントリをメンテナンスするキャッシュメンテナンスステップと、
を備えることを特徴とするキャッシュメンテナンス方法。
In a cache maintenance method for maintaining a cache entry as a unit for storing the data in the cache in a distributed memory cache that stores data from a database in a cache configured by one or more computer memories,
A maintenance determination step that refers to a maintenance condition that is a condition for maintaining the cache entry and determines that maintenance is possible when the maintenance condition is satisfied;
If it is determined that maintenance is possible in the maintenance determination step, a cache maintenance step for maintaining the cache entry;
A cache maintenance method comprising:
コンピュータを、請求項1から請求項7の何れか一項に記載のキャッシュメンテナンス装置を構成する各手段として機能させるためのキャッシュメンテナンスプログラム。   A cache maintenance program for causing a computer to function as each means constituting the cache maintenance device according to any one of claims 1 to 7.
JP2009041612A 2009-02-25 2009-02-25 Cache maintenance device, method and program thereof Pending JP2010198258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009041612A JP2010198258A (en) 2009-02-25 2009-02-25 Cache maintenance device, method and program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009041612A JP2010198258A (en) 2009-02-25 2009-02-25 Cache maintenance device, method and program thereof

Publications (1)

Publication Number Publication Date
JP2010198258A true JP2010198258A (en) 2010-09-09

Family

ID=42822931

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009041612A Pending JP2010198258A (en) 2009-02-25 2009-02-25 Cache maintenance device, method and program thereof

Country Status (1)

Country Link
JP (1) JP2010198258A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015097774A1 (en) * 2013-12-25 2015-07-02 株式会社日立製作所 Computer system and data management method
JP2015146201A (en) * 2010-12-20 2015-08-13 セールスフォース ドット コム インコーポレイティッド Method and system for performing cross-sectional store joint in multi-tenant store
JP2017191600A (en) * 2016-04-11 2017-10-19 レベル スリー コミュニケーションズ,エルエルシー Invalidation in content delivery network (cdn)
JP2018133100A (en) * 2010-12-30 2018-08-23 フェイスブック,インク. Distributed cache for graph data

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015146201A (en) * 2010-12-20 2015-08-13 セールスフォース ドット コム インコーポレイティッド Method and system for performing cross-sectional store joint in multi-tenant store
JP2018133100A (en) * 2010-12-30 2018-08-23 フェイスブック,インク. Distributed cache for graph data
WO2015097774A1 (en) * 2013-12-25 2015-07-02 株式会社日立製作所 Computer system and data management method
JP6034512B2 (en) * 2013-12-25 2016-11-30 株式会社日立製作所 Computer system and data management method
US9934248B2 (en) 2013-12-25 2018-04-03 Hitachi, Ltd. Computer system and data management method
JP2017191600A (en) * 2016-04-11 2017-10-19 レベル スリー コミュニケーションズ,エルエルシー Invalidation in content delivery network (cdn)

Similar Documents

Publication Publication Date Title
US11647097B2 (en) Providing access to managed content
US10803047B2 (en) Accessing data entities
AU2016382908B2 (en) Short link processing method, device and server
US9251210B2 (en) Caching external data sources for SQL processing
US9286293B2 (en) Populating and using caches in client-side caching
US10275347B2 (en) System, method and computer program product for managing caches
CN105426321B (en) Using RDMA close friend&#39;s caching method of remote location information
CN108055302A (en) A kind of image cache processing method, system and server
US20120166419A1 (en) Method, system and program for cache control in database
US10474185B2 (en) Timestamp alignment across a plurality of computing devices
Ma et al. An improved web cache replacement algorithm based on weighting and cost
CN105159845A (en) Memory reading method
CN101404649B (en) Data processing system based on CACHE and its method
JP2010198258A (en) Cache maintenance device, method and program thereof
US9928174B1 (en) Consistent caching
WO2022127866A1 (en) Data processing method and apparatus, and electronic device and storage medium
EP3507699B1 (en) Method and systems for master establishment using service-based statistics
JP2005063374A (en) Data management method, data management device, program for the same, and recording medium
CN115878677B (en) Data processing method and device for distributed multi-level cache
US11269784B1 (en) System and methods for efficient caching in a distributed environment
CN113490933A (en) Distributed data processing
US10747782B2 (en) Efficient dual-objective cache
US20150100545A1 (en) Distributed database system and a non-transitory computer readable medium
Ryeng et al. Site-autonomous distributed semantic caching
CN113138943A (en) Method and device for processing request