• 沒有找到結果。

Chapter 5 Hybrid Web Cache Replacement Algorithm

C. Cache Hit in hot zone : The hitted object is moved to the head of the hot zone (C of Figure 5-1)

5.2 Performance evaluation

5.2.5 Increasing number of zones

We further evaluate a three- zone hybrid algorithm consisting of an upper LRU zone, a middle LRU zone, and a lower GD-Family zone. The evaluated three- zone hybrid algorithm is equivalent to a two-zone hybrid algorithm consisting of a hot LRU zone and a cold two-zone hybrid zone. From another point-of-view, this three-zone hybrid algorithm is equivalent to a two-zone hybrid algorithm consisting of a hot SLRU zone and a cold GD-Family zone except that a missed object is inserted into the hot SLRU zone. The proposal of this three-zone hybrid algorithm is inspired by the fact that SLRU outperforms LRU in terms of both DHR and BHR. Therefore, we evaluate the performance of this three- zone hybrid algorithm to see if DHR and BHR can be further improved.

We do not show the simulation as figures for saving space since balancing of the space ratio of the three zones is more complex than in the two- zone hybrid algorithm. According to the characteristics of LRU, GD-Family, and multi- zone hybrid algorithms, increasing the space ratio of hot zone increases BHR but decrease DHR. Besides, increasing the space ratio of cold zone increases DHR but decrease BHR. Moreover, increasing the space ratio of middle zone increases BHR and slightly decreases DHR. This is attribute to the higher BHR of the middle LRU zone than that of a middle GD-Family zone. Furthermore, the combined space ratio of middle zone and cold zone significantly determine if a newly fetched object or an object removed from hot zone will be removed from the cache soon. Therefore, none of the three zones can be allocated a small space ratio otherwise the performance will significantly

fall behind that of a two-zone hybrid algorithm.

According to the simulation results, we find that three-zone hybrid algorithm can slightly outperform two- zone hybrid algorithm only with limited space ratio allocation.

However, it may not be efficient and practical to spend time finding such proper space ratio allocation while the improvement is slight. Furthermore, diving cache space into too many zones increases maintenance overhead for moving objects between zones. As a result, we conclude that two-zone hybrid algorithm is enough.

5.3 Summary

From the simulation result, we can see that the proposed hybrid algorithm can improve DHR of LRU by using a GD variant that is good at DHR while preserving most byte hit of LRU. The resulting DHR is slightly lower than that can be achieved by GDSP and the resulting BHR is slightly lower than that of LRU. Besides, the combination of hot LRU zone and cold GDSP zone, we have combined other algorithms in the proposed two-zone hybrid algorithms. For example, a GD variant whose utilization function is )

)

cold zone will not excessively favor small objects and therefore the resulting BHR is slightly higher than that of the combination of hot LRU and cold GDSP, but the resulting DHR is degraded more greatly. According to these simulation results, we infer that it maybe be a good idea to combine an algorithm very good at BHR with another algorithm very good at DHR as long as these two algorithms do not conflict.

Compare to a pure GD-Family, the combination of hot LRU and cold GDSP can achieve approximately the same hit ratios with less maintenance cost. Table 5-2 shows the maintenance cost of LRU, GD-Family, and the proposed two- zone hybrid algorithm. The first three rows show the data structure used to maintain objects and the maintenance cost for five simple operations. The last two rows show the maintenance cost of cache hit and cache miss, which are consisted of several simple operations. In comparison with the maintenance cost of

Table 5-2. Maintenance costs of LRU, GD-Family, and proposed hybrid algorithm

*: Depends on probability of hash collision

**: May perform V times, where V depends on number of victims

GD-Family, the proposed hybrid algorithm has reduced cost when cache hits in hot zone, equal cost when cache misses, and extra maintenance cost when cache hits in cold zone. This extra cost, of O(log n), is for moving objects (hereafter referred to as internal victim(s)) from the hot zone to the cold zone in order to make space for promoting a hitted object of the cold zone to the hot zone. Note that each time the hybrid cache will move different number of internal victims since web objects are of different size. For example, if a promoted object is larger than the object at the tail of the hot zone, the number of internal victims will be more than one. On the other hand, if a promoted object is smaller than the object at the tail of the hot zone, removing the object at the tail of the hot zone will make extra free space and

shows the average number of internal victims in our simulations with different cache size. The average number of internal victims is slightly smaller than one as cache size is small and decreases as cache size increases. Such increase may due to popular objects are often of small size.

Table 5-3. Average number of internal victims Traces

BO2 SD UC SV NY RTP PA PB SJ BO1

0.005 0.99 1.00 0.99 0.99 1.00 1.00 0.99 1.00 1.00 0.99

0.01 0.99 0.99 0.98 0.98 1.00 0.99 0.99 0.99 1.00 0.99

0.02 0.98 0.99 0.98 0.97 0.99 0.98 0.97 0.98 0.99 0.98

0.04 0.97 0.97 0.97 0.95 0.97 0.98 0.93 0.97 0.99 0.97

0.08 0.93 0.95 0.96 0.92 0.95 0.97 0.87 0.94 0.97 0.94

0.16 0.85 0.93 0.90 0.88 0.89 0.92 0.76 0.89 0.95 0.89

0.32 0.76 0.89 0.81 0.76 0.79 0.86 0.49 0.82 0.93 0.79

0.64 0.55 0.77 0.65 0.60 0.60 0.76 0.20 0.67 0.85 0.59

1.28 0.22 0.57 0.44 0.49 0.31 0.59 0 0.42 0.76 0.30

2.56 0 0.21 0.15 0.28 0 0.36 0 0.09 0.42 0

However, such extra cost does not occur frequently since less than 20% of total document hits are in cold zone for small cache and the percentage of total document hits in cold zone gradually reduce as cache size grows. Therefore, the proposed hybrid algorithm does not incur extra maintenance cost frequently. For example, if the DHR in cold zone is Hc=0.05 and the DHR in hot zone is Hh=0.3, the proposed hybrid algorithm has 5% of chance to incur extra cost and 30% of chance to save cost. Compared with a GD-Family algorithm having a DHR=0.37, the relative chance of saving cost will be 0.3/0.37=81%, a significantly great chance. As a result, we conclude that the hybrid algorithm provide high DHR and BHR efficiently.

Size(GB)