# Replicas Strategy and Cache Optimization of Video Surveillance Systems Based on Cloud Storage
## 6 Experiments and Analysis
### Data Cache Strategy Based on Location Correlation  
We also evaluate the data cache strategy based on location correlation (LC-cache) and set up two sets of experiments. The first group of experiments is to verify LC-cache strategy can reduce the response time of reading data effectively; the second group of experiments is to verify the hit rate of LC-cache. LC-cache is compared with other two strategies (CloudCache and LRU [28]). The design and results of the two sets of experiments are presented separately. In CloudCache strategy, as the increase of cache size, the average reading speed is significantly increased, and the hit rate is gradually increased [23]. We set LC-cache strategy's cache pool as mentioned in Section 5. To compare response time and hit rate, the two strategies have the same cache size (16 MByte). In the first group of experiments, we have implemented the surveillance environment in Figure 2 by using twelve cameras; the cameras are named in accordance with Figure 2. Firstly, according to Table 5, we set the location correlation between the cameras. Then, we design three paths, Path-1: exit C\(\rightarrow\)exit D, Path-2: exit C\(\rightarrow\)exit A, Path-3: exit C\(\rightarrow\)exit B, record and compare the response time of data read when using different cache strategy. Figure 6 shows the first playback response time under different cache strategies. According to the response time recorded in Figure 6, in the beginning, each cache strategy has no pre-cached data, so there has almost the same response time when access 3-1 camera. After that, we find that LC-cache strategy can improve the response time of data read significantly. According to the location correlation between the cameras, the first two GOP data segments of the video file may be added to the cache pool in advance, so the speed of reading data get significantly improved. The reduced response time is the time to query the location of the video file in the storage system and opens the file to read the data. The LRU cache does not have any data at the beginning of the experiment, nor does the data reading frequently in the experiment. The LRU cache mechanism has almost no effect in this case. Hence, there is nearly no difference between the LRU cache mechanism and no cache mechanism. After the first experiment, each strategy will cache some data. We repeat the experiment 100 times with path 2, record and calculate the average response time of the camera under different cache strategies, as shown in Figure 7. We find that the LC-cache strategy shows a better efficiency of the data access, compared with the other two strategies (CloudCache and LRU). In the second group of experiments, we are primarily evaluating the hit rate of the cache pool. We designed four sets of video-on-demand sequences, as shown in Table 6. The first group is the way to track pedestrians, the second group is in random order, and the above two groups are in the same period. Besides, the video-on-demand methods that are used by the other two groups are the same with the first two groups respectively, but the time of playback is also random. We repeat this experiment 100 times. Figure 6 shows the hit rate in each case. Figure 6: The First Playback Response Time. According to the experimental data in Figure 8, we can see that the LC-cache strategy only has an obvious advantage in the first group while in the other three groups, the cache hit rate does not have any advantage. The reason is that the data cache strategy is mainly based on cameras' locations and time correlation of video file, and predicts the user's playback behaviors in advance. Hence, it is not surprising that the hit rate is lower in the other three groups of experiments. However, in the real surveillance system, the user's playback behavior often has location and time relevance, so the proposed location correlation data cache strategy not only can reduce the response time of data read but also have a higher cache hit rate in the real distributed video surveillance system.