VideoCache

Cache directory has exceeded the maximum size allowed?

by Anonymous on 4 Sep 2009

Working with 1.9.2 here, and I get this error in my videocache.log:

2009-09-04 12:53:12,208 12998 x.x.x.x 64c80ffd1e206275 SCHEDULED YOUTUBE Video scheduled for download.
2009-09-04 12:53:12,209 13103 x.x.x.x 64c80ffd1e206275 CACHE_FULL YOUTUBE Cache directory '/var/spool/videocache/' has exceeded the maximum size allowed.

So I check,

[root@proxy ~]# du -sh /var/spool/videocache/
164M    /var/spool/videocache/
[root@proxy ~]# cat /etc/videocache.conf | grep ^base_dir
base_dir = /var/spool/videocache/:65536

What am I missing here? It seems that videocache should be allowed to dump ~65G of videos into /var/spool/cache before I receive an error message like the one I am seeing.

6 Answers

by jfiske on 4 Sep 2009

I am the OP. I should also note that /var/spool/videocache/ is actually a symlink to /var/spool/squid/videocache/ which a df reports has 803G free.

by Kulbir Saini on 4 Sep 2009

jfiske,

This may be problem due to the symlink. Can you try specifying /var/spool/squid/videocache/ as your cache_dir?

by jfiske on 4 Sep 2009

I updated to /var/spool/squid/videocache/, restarted squid ... same problem :-/

Any other ideas?

by Kulbir Saini on 6 Sep 2009

jfiske,

Please apply the following patch to your /usr/share/videoacache/videocache.py and restart squid.

diff --git a/videocache/videocache.py b/videocache/videocache.py
index 2806773..4df42bb 100755
--- a/videocache/videocache.py
+++ b/videocache/videocache.py
@@ -413,14 +413,8 @@ def download_from_source(args):
         disk_stat = os.statvfs(cache_dir)
         disk_available = disk_stat[statvfs.F_BSIZE] * disk_stat[statvfs.F_BAVAIL] / (1024*1024.0)
         video_id_pool = ServerProxy('http://' + rpc_host + ':' + str(rpc_port))
-        # If cache_size is not 0 and the cache directory size is more than cache_size, we are done with this cache directory.
-        #if cache_size != 0 and video_id_pool.get_cache_dir_size(base_tup[0]) >= cache_size:
-        if cache_size != 0:
-            log(format%(pid, client, video_id, 'CACHE_FULL', type, 'Cache directory \\'' + base_tup[0] + '\\' has exceeded the maximum size allowed.'))
-            # Check next cache directory
-            continue
         # If disk availability reached disk_avail_threshold, then we can't use this cache anymore.
-        elif disk_available < disk_avail_threshold:
+        if disk_available < disk_avail_threshold:
             log(format%(pid, client, video_id, 'CACHE_FULL', type, 'Cache directory \\'' + base_tup[0] + '\\' has reached the disk availability threshold.'))
             # Check next cache directory
             continue

Thank You!

by Everton on 4 Feb 2010

I had the same problem before applying the patch. After that, the msg disappeared, but the cache directory continues grow, even with the size set at base_dir. I notice that they don’t change to the second cache directory too.

Here is my base_dir configuration:
base_dir = /var/spool/videocache/:32768|/var/spool/videocache2/:32768

by Ted on 7 Feb 2010

how to apply this patch ???

You need to sign in. Please sign in to add answer to this question.