Algorithm for cache replacement
First Claim
1. In a system containing a set of objects and wherein each object has an object value associated with it, said system adapted to provide a priority queue and at least one data structure, a method for identifying an object with a low object value comprising the steps of:
- determining a thresho1d value;
comparing the object value to said threshold value for at least one object;
placing one or more objects for which the object value is greater than said threshold value on a data structure; and
placing one or more objects for which the object value is not greater than said threshold value on said priority queue;
identifying one or more objects in the system having low object values by examining at least one of said priority queue and said data structure; and
ordering said objects on said priority queue based on said object value.
1 Assignment
0 Petitions
Accused Products
Abstract
In a computer system in which caching is utilized for improving performance, a method for determining whether an uncached object should be cached, and, if so, which objects, if any, should be removed from a cache to make room for the new uncached object. The method assigns a metric correlated with the desirability of caching an object, considering parameters such as access frequencies, object sizes, object lifetimes and times to calculate and/or to fetch the object. The metric weights more recent accesses more heavily than less recent accesses. The method can be used for improving the performance of an algorithm which utilizes priority queues and can additionally be applied when attempting to predict the expected frequency of an occurrence based upon past occurrences.
145 Citations
79 Claims
-
1. In a system containing a set of objects and wherein each object has an object value associated with it, said system adapted to provide a priority queue and at least one data structure, a method for identifying an object with a low object value comprising the steps of:
-
determining a thresho1d value;
comparing the object value to said threshold value for at least one object;
placing one or more objects for which the object value is greater than said threshold value on a data structure; and
placing one or more objects for which the object value is not greater than said threshold value on said priority queue;
identifying one or more objects in the system having low object values by examining at least one of said priority queue and said data structure; and
ordering said objects on said priority queue based on said object value. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 79)
-
-
14. In a system having at least one cache manager managing one or more caches including a priority cache for ordering objects by caching value, in which at least one cache contains at least one cached object having an object caching value, a method for determining priority of objects in at least one of said one or more caches which contain an object comprising the steps of:
-
periodically calculating one or more caching values; and
comparing one or more caching values to at least one object caching value of the at least one cached object. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)
maintaining an auxiliary data structure at least partially ordered by said auxiliary value; and
placing one or more objects for which said caching values exceeds said threshold value on said auxiliary data structure.
-
-
26. The method of claim 24 further comprising determining if an object is to be placed on a priority queue comprising calculating a new object caching value for said object and comparing said calculated caching value to said threshold caching value.
-
27. The method of claim 26 further comprising placing said object on said priority queue if said new object caching value is not greater than said threshold caching value.
-
28. The method of claim 24 further comprising changing said threshold caching value.
-
29. The method of claim 14 further comprising determining if an uncached object is to be cached comprising calculating a new object caching value for said uncached object and identifying at least one cached object for removal from said cache.
-
30. The method of claim 29 wherein said identifying comprises identifying a set of cached objects having low caching values whose removal from said cache would make room for said new object.
-
31. The method of claim 30 further comprising obtaining an average caching value for said set and comparing said average caching value to said new object caching value.
-
32. The method of claim 31 in which said average caching value is weighted by the sizes of objects in said set.
-
33. The method of claim 30 further comprising maintaining information regarding accesses to said objects and including in said set those objects which are least recently accessed.
-
34. The method of claim 31 further comprising caching said new object only if said new object caching value exceeds said average caching value.
-
35. The method of claim 23 wherein said calculating of said caching value for at least one object comprises applying the formula:
- (t/a−
t*p/u)/s, where a is the expected time between successive requests for the object, t is the expected time to fetch or create the object, u is the expected time between successive updates of the object, p is the probability that the object will be accessed between successive updates to the object, and s is the expected object size.
- (t/a−
-
36. The method of claim 35 wherein p is determined using a quantity correlated with 1−
- ((a−
1)/a)u.
- ((a−
-
37. The method of claim 35 wherein a is calculated based upon object accesses.
-
38. The method of claim 35 wherein u is calculated based upon object updates.
-
39. The method of claim 37 wherein a is calculated by a method comprising the steps of:
-
maintaining a variable event_latency representing an estimate of the expected time between successive accesses;
maintaining a variable last_event_time representing the time of a previous access;
after occurrence of a new access, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time−
last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.
-
-
40. The method of claim 38 wherein u is calculated by a method comprising the steps of:
-
maintaining a variable event_latency representing an estimate of the expected time between successive updates;
maintaining a variable last_event_time representing the time of a previous update;
after occurrence of a new update, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time_last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.
-
-
41. A method for estimating how frequently events occur comprising the steps of:
-
maintaining a variable event_latency representing an estimate of the expected time between successive events;
maintaining a variable last_event_time representing the time of a previous event;
after occurrence of a new event, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time−
last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.- View Dependent Claims (42, 43)
-
-
44. A method for calculating a caching value for an object comprising the steps of:
-
determining the expected time, a, between successive requests for the object;
determining the expected time, t, to fetch or create the object;
determining the expected time, u, between successive updates of the object;
determining the probability, p, that the object will be accessed between successive updates to the object;
determining the expected object size, s; and
applying the formula (t/a−
t*p/u)/s.- View Dependent Claims (45, 46, 47)
-
-
48. A system containing a set of objects comprising:
-
storage means;
at least one priority queue;
at least one data structure;
means for calculating a caching value for each object by applying the formula;
(t/a−
t*p/u)/s, where a is the expected time between successive requests for the object, t is the expected time to fetch or create the object, u is the expected time between successive updates of the object, p is the probability that the object will be accessed between successive updates to the object, and s is the expected object size; and
means for determining treatment of said object based on said caching value.
-
-
49. A system containing a set of objects comprising:
-
storage means;
at least one priority queue adapted to allow objects to be identified in ascending order of object caching values starting from the object with the lowest object caching value;
at least one data structure;
means for calculating an object caching value for each object; and
means for determining treatment of said object based on said object caching value. - View Dependent Claims (50, 51, 52, 53)
threshold means for determining a threshold value;
a comparison component for comparing the object caching value to said threshold value for at least one object; and
wherein said system places one or more objects for which the object caching value is greater than said threshold value on the data structure and places one or more objects for which the object caching value is not greater than said threshold value on the priority queue.
-
-
51. The system of claim 50 further comprising means for identifying one or more objects in the system having low object caching values by examining at least one of said priority queue and said data structure.
-
52. The system of claim 49 wherein said priority queue is implemented using one or more B-+ trees.
-
53. The system of claim 49 wherein said data structure comprises a list ordered by how recently said objects have been accessed.
-
54. A system for estimating how frequently events occur comprising:
-
a variable event_latency representing an estimate of the expected time between successive events;
a variable last_event_time representing the time of a previous event;
processing component for, after occurrence of a new event, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time−
last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.
-
-
55. In a system having at least one cache managers managing one or more caches in which at least one cache contains at least one cached object having an object caching value, a method for determining priority of objects in at least one of said one or more caches which contain an object comprising the steps of:
-
periodically calculating one or more caching values; and
comparing one or more caching values to at least one object caching value of the at least one cached object. - View Dependent Claims (56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78)
maintaining an auxiliary data structure at least partially ordered by said auxiliary value; and
placing one or more objects for which said caching values exceeds said threshold value on said auxiliary data structure.
-
-
66. The method of claim 64 further comprising changing said threshold caching value.
-
67. The method of claim 64 further comprising determining if an uncached object is to be cached comprising calculating a new object caching value for said uncached object and identifying at least one cached object for removal from said cache.
-
68. The method of claim 67 wherein said identifying comprises identifying a set of cached objects having low caching values whose removal from said cache would make room for said new object.
-
69. The method of claim 68 further comprising obtaining an average caching value for said set and comparing said average caching value to said new object caching value.
-
70. The method of claim 69 in which said average caching value is weighted by the sizes of objects in said set.
-
71. The method of claim 68 further comprising maintaining information regarding accesses to said objects and including in said set those objects which are least recently accessed.
-
72. The method of claim 69 further comprising caching said new object only if said new object caching value exceeds said average caching value.
-
73. The method of claim 63 wherein said calculating of said caching value for at least one object comprises applying the formula:
- (t/a−
t*p/u)/s, where a is the expected time between successive requests for the objects t is the expected time to fetch or create the object, u is the expected time between successive updates of the object, p is the probability that the object will be accessed between successive updates to the object, and s is the expected object size.
- (t/a−
-
74. The method of claim 73 wherein p is determined using a quantity correlated with 1−
- ((a−
1)/a)u.
- ((a−
-
75. The method of claim 73 wherein a is calculated based upon object accesses.
-
76. The method of claim 73 wherein u is calculated based upon object updates.
-
77. The method of claim 75 wherein a is calculated by a method comprising the steps of:
-
maintaining a variable event_latency representing an estimate of the expected time between successive accesses;
maintaining a variable last_event_time representing the time of a previous access;
after occurrence of a new access, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time−
last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.
-
-
78. The method of claim 76 wherein u is calculated by a method comprising the steps of:
-
maintaining a variable event_latency representing an estimate of the expected time between successive updates;
maintaining a variable last_event_time representing the time of a previous update;
after occurrence of a new update, at time new_event_time, updating event_latency using the formula;
new event_latency=((new_event_time−
last_event_time)+(k−
1)*old event_latency)/k for a weighting factor k.
-
Specification