Implementation of cache data distribution

Implementation of cache data distribution especially strategy is as follows.(a) Analyzing the Query Log and Calculating the Hot Value of Every Query. Analyzing the query log is the first step. Then, we calculate the hot value of every query. The next step is to open the query log file, read the query log contents, and extract every query item. We calculate the total times of queries, the first time of query, and the last time of query. We know that the query with high frequency has greater hot value. However, getting hot spot just based on query times and query frequency may get a past hot spot; the users are less likely to query the requests. Thus, two characteristics are introduced into the paper; they are Query Life-Cycle and Query Inactive Time. Query Inactive Time is the current system time minus the last query appearing in the query log.

First, we calculate the query frequency; the query with higher frequency is more likely to be hot content. Putting these queries in the cache will increase the hit rate. Because the cache structure based on log is built on web collection system, the log will be generated every day. When calculating the query frequency, the system will run 24 hours; therefore, the query frequency is calculated as follows:Freg=QueryNum24?3600.(1)In the formula, QueryNum is the number of queries times.The interval time is calculated as follows:IntervalTime=1Freq.(2)Query Life-Cycle is the time between the first occurrence of a query and the last occurrence, which is calculated as follows:LiveTime=LastTime?FirstTime.

(3)In the formula, LastTime is the time of its last occurrence and FirstTime is the time of its first occurrence.To ensure the accuracy of hot content after statistical calculating, the system introduces a characteristic called NotActiveTime. NotActiveTime is the current system time minus the last query in the query log. NotActiveTime is calculated as follows:NotActiveTime=CurrentTime?LastTime.(4)In the formula, CurrentTime is current time and LastTime is the last time of the query.After statistical calculating, for each query, we can get its query frequency Freg, its live time LiveTime, and its not active time NotActiveTime. The hot value of a query is proportional to Freg and LiveTime, and it is inversely proportional to NotActiveTime. The system calculates the hot value based on these three variables.

And HotValue is calculated as follows:HotValue=Freq?LiveTime?1NotActiveTime.(5)With the above formula of HotValue, the system will calculate the hot value of every query and then sort the queries by Brefeldin_A HotValue in descending order.(b) Initialization of Static Cache and Dynamic Cache Ache. Data initialization can be divided into two parts: one is static cache data initialization and the other is dynamic cache data initialization. Dynamic cache data initialization is very simple. The system just needs dynamic cache area.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>