A cache replacement policy for transcoding proxy ... - Semantic Scholar

2 downloads 0 Views 205KB Size Report
A cache replacement policy for transcoding proxy servers. K.H. Yeung*a), C.C. Wong**b), K.Y. Wong***c) and S.Y. Hui****d). Summary. A cache replacement ...
A cache replacement policy for transcoding proxy servers K.H. Yeung*a), C.C. Wong**b), K.Y. Wong***c) and S.Y. Hui****d) Summary A cache replacement policy which take the transcoding time into account in making replacement decisions, for the emerging transcoding proxy servers is proposed. Simulation results show the proposed policy outperforms the conventional LRU in both the cache hit rate and the average object transcoding time.

Key words: multimedia communications, data communications, Web cache, transcoding server

1. Introduction With the recent rapid growth in mobile Internet, it is quite certain that the use of transcoding proxies [1] will become more and more popular. Transcoding is the process of converting an object from one form to another. For example, an image can be changed from a 16-bit true color one to a grayscale one, or an image of 800*600 pixels can be changed to a lower resolution version of 640*480. Transcoding can be also performed on video and image objects. Apart from the same media types, object conversion between different media types, such as speech to text, is also a type of transcoding. Transcoding generally aims at object size decrement. This reduction in size is very important when the object is displayed on a third generation (3G) mobile device. Due to the limited physical sizes and processing power of mobile devices, images cannot be displayed in their exactly original formats. Transcoding is therefore required to prepare the data for subsequent accesses by mobile devices. It is expected that transcoding will become a very popular technique in future. The most significant difference between a transcoding proxy [1] and a traditional HTTP proxy [2] is the transcoding subsystem. The transcoding subsystem is integrated into the HTTP proxy, usually without much modification. The subsystem is divided into two modules: transformation and policy. While the transformation module is related to the transcoding process, the policy module is related to the replacement policy for objects in cache. Unfortunately, the traditional cache replacement policies (such as LRU, LFU and GDS) may not perform well when they are used in a transcoding proxy. This is because they do not consider an important metric, namely *,**** The authors are with City University of Hong Kong, Hong Kong. ** The author is a graduate from City University of Hong Kong, Hong Kong. *** The author is with Macao Polytechnic Institute, Macao. a) E-mail: [email protected] b) E-mail: [email protected] c) E-mail: [email protected] d) E-mail: [email protected]

the transcoding time, in making replacement decisions. If an object requires longer transcoding time, the cost of cache miss of it is higher. Therefore,a proxy should consider whether an object is worthwhile to be kept in order to minimize the time wasted in re-transcoding the object. (Although some existing proxies use the metric of file size, the metric is different from transcoding time. It is because two different objects have the same size but different formats could result in different transcoding time.) It is an engineering challenge in designing an efficient transcoding replacement policy. In this letter, a transcoding replacement policy is proposed and its performance is compared with that of the most commonly used LRU policy.

2. Proposed Cache Replacement Policy Consider that an Internet environment contains N unique objects, and the local cache space can store a subset of them. Each object i, 1≤i≤N, has a size si and access probability pi, where Σpi=1. In practice, the access probabilities of objects can be obtained by record counts. Once an object is accessed, its count will be increased by one. For a given period, says one day, the proxy server will collect these counts and determine the latest access probability of each object. Define Ti be the transcoding time of object i. And define wi = piTi be the weighting for object i. When the proxy need to evict an object, in order to minimize the overall transcoding time it should remove the object(s) with the smallest weight(s) in the cache. However, this replacement is made only when the weight of the newly requested object is larger than the total weight of the objects that are going to be replaced. To implement the policy, the objects in the cache are sorted according to their weights in descending order to form a weight list. Thus, the object with the smallest wi is put at the bottom of the list. When a replacement decision has to be made, says a new object (not in the cache) with weight wnew and size snew is accessed, the new object will only replace the bottom X objects of the list if and only if X

wnew ≥

∑w

(1)

k

k =1

where X is the smallest number of objects at the bottom of the weight list while satisfying the condition X

∑s k =1

X +1 k

≤ snew ≤

∑s

k

(2)

k =1

In this way, the objects with relatively larger weight will always be cached, and the overall transcoding time can be reduced substantially, as will be seen in the result section.

3. Transcoding Time of Image Object Before comparing the performance between the proposed and the traditional replacement polices, we have to obtain the transcoding time of a requested object. R. Han et al. have shown [1] that the transcoding time of an image is almost directly proportional to the number of pixels of that image, especially for JPEG images. Therefore a linear formula can be used to obtain the transcoding time for an object. That is Ti = a ( xi ) + b (3) where Ti is the transcoding time of object i, xi is the number of pixels of object i, a is a factor reflecting the per pixel transcoding time, and b is the transcoding time of the header of an image. By giving the values of a and b, the transcoding time of an object can be obtained. In the study of R. Han et al. [1], two sets of previously transcoded images with different image-quality factors were used. For one set, b=45 ms and a=2.5×10-3 ms/pixel were obtained, while for another set, b=95 ms and a=3×10-3 ms/pixel were obtained. Since b is insignificant when compared with the transcoding time of large objects, b is set to a fixed value of 70 ms in this study. Note also the value of a is insensitive to the image quality. We therefore use a fixed value of 2.75×10-3 ms/pixel as the value of a in this study. Moreover, since the machine used in [1] was rather slow (200MHz Pentium Pro), we expect the processing power of today's proxies should be at least ten times greater, so a and b should be scaled down by ten times. Finally, the transcoding time for an object is given by (in ms): (4) Ti = (2.75 × 10 −4 ) xi + 7

probabilities. The R requests are then fitted into the simulated transcoding proxy. We ran three simulations with different combinations of N and R for comparing the performance of the conventional LRU and the proposed replacement policies. In each simulation, we generate five sets of request streams from different random seeds. The cache size is set to be 2G bytes. Average transcoding time can then be obtained. As shown in Table 2, the proposed policy outperforms the conventional LRU by providing 21% to 32% improvement in cache-hit rate and cache-byte-hit rate. Moreover, the proposed policy has reduced the average transcoding time by about 40%. The results thus conclude that the proposed policy should be used in transcoding proxies for performance improvement. Resolution 640x480 800x600 1024x768 1152x864 1280x960 1280x1024 1344x1008 1536x1024 1600x1200 1760x1168 1792x1184 1800x1200 1712x1368 1856x1392 2000x1312 1984x1360 2160x1440 2048x1536 2400x1800 3040x2016

Table 1. Objects sizes used in the simulations No. of Original size Level 6 (k Level 3 pixels (k) (k byte) byte) (k byte) 300 1,200 636 277 469 1,875 994 433 768 3,072 1,628 710 972 3,888 2,061 898 1,200 4,800 2,544 1,109 1,280 5,120 2,714 1,183 1,323 5,292 2,805 1,222 1,536 6,144 3,256 1,419 1,875 7,500 3,975 1,733 2,008 8,030 4,256 1,855 2,072 8,288 4,393 1,915 2,109 8,438 4,472 1,949 2,287 9,149 4,849 2,113 2,523 10,092 5,349 2,331 2,563 10,250 5,433 2,368 2,635 10,540 5,586 2,435 3,038 12,150 6,440 2,807 3,072 12,288 6,513 2,839 4,219 16,875 8,944 3,898 5,985 23,940 12,688 5,530

4. Simulation Results Since the proposed replacement policy is designed for transcoding proxies, its performance must be tested in an environment in which a large amount of image traffic is found. To create such an environment, a set of image objects was generated for performance simulation. In the request generation process, we use a total of 20 different resolutions (all in JPEG format) that are commonly used in digital images. We assume the images are in 32-bits true colour, i.e. 4 bytes per pixel. When using the Independent JPEG Group’s library to recode them into three visually significant different qualities (level 6, 3 and 1 of the library) [3], we obtain 60 different object sizes as listed in Table 1. As mentioned before, there are N global objects in the system, we use Zipf distribution to define the access probability (pi) of the N objects. And the size of each object (si) is randomly chosen from the 60 possible ones as listed in Table 1. To generate a request stream with R requests, R objects are picked from the N objects based on their access

Level 1 (k byte) 131 204 335 424 523 558 577 670 818 875 903 920 997 1,100 1,117 1,149 1,324 1,339 1,839 2,609

Table 2. Simulation results Average hit Average byte hit Average transcoding rate rate time (µs) LRU Proposed policy % improvement

Simulation 1: N = 10000, R = 20000 0.645 0.630 0.212 0.784 0.774 0.129 21.55% ↑ 22.86% ↑ 39.15% ↓

LRU Proposed policy % improvement

Simulation 2: N = 20000, R = 30000 0.588 0.568 0.245 0.766 0.753 0.139 30.27% ↑ 32.57% ↑ 43.27% ↓

LRU Proposed policy % improvement

Simulation 3: N = 30000, R = 30000 0.556 0.552 0.265 0.735 0.735 0.158 32.19% ↑ 33.15% ↑ 40.38% ↓

Acknowledgement This research is supported by City University Research Grant numbered 7001052.

References [1]

HAN, R., BHAGWAT, P., LAMAIRE, R., MUMMERT, T., PERRET, V., and RUBAS, J.: 'Dynamic Adaptation in an Image Transcoding Proxy for Mobile Web Browsing', IEEE Personal Communication, 1998, pp. 8-17 [2] WONG, K.Y., and YEUNG, K.H.: 'Site-based approach to Web cache design', IEEE Internet Computing, 2001, 5, (5), pp. 28-34 [3] KANGASHARJU, J., KWON, Y.G., and ORTEGA, A.: 'Design and Implementation of a Soft Caching Proxy', Computer Networks and ISDN Systems, 1998, 30, (22-23), pp. 2113-2121