> I'm using Zend_Cache to cache all queries from mysql server.
> Currently I have about 12.000 cached files and sometimes (1/10) Zend_Cache
> takes up to 10 seconds to load the cache.
> I'm using file store on a Debian.
> is there any way we can speed this up?
> 10 seconds is a long time to wait for a cache to load,
At a guess, it's due to Linux taking a long time to open the directory
as there are so many files in it.
Are you able to use any other backend? (e.g. memcached)
If you wish to keep using files, the only way to improve performance
would be to have some sort of directory hashing used so there aren't
zillions of files in one directory.
David Goodwin Pale Purple Limited
Office: 0845 0046746 Mobile: 07792380669
http://www.palepurple.co.uk Company No: 5580814
'Business Web Application Development and Training in PHP'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
And besides the manual says that using the file cache is only recommended when you know you won't have that amount of cached files in the cache directory. Since in that point the bottleneck will be the cache.
I'm using Zend_Cache to cache all queries from mysql server.
Be aware that MySql can cache queries (if your setup has this turned on) and some queries are quicker than a file based cache (I assume your cache is file based).
Currently I have about 12.000 cached files and sometimes (1/10) Zend_Cache takes up to 10 seconds to load the cache.
How do you decide what you need to cache? The only time that I cache something is when I know it is very slow and can be speed up. I profile with XDebug to find this out. Caching everything possible can actually slow things down if you are caching something that was originally quicker than accessing a file.
is there any way we can speed this up?
If you are using file based caching, I would recommend that you move to sqlite based cache at least. Memcache would be nice but it not as available. At least sqlite seems faster than a file based cache.
Has anyone suceed in having hashed_directory_leve different than 0?
In my case, everything works fine when the hashed_directory_level is set to
As soon as I increase the value to 1 or 2 (I have a couple of hundred
thousands articles to be cached in my website), the cache does not respond
Some cache directories are being created, but they are empty and no files
are stored within them.
I have tried this in 2 servers (almost the same architecture) and the
result is the same.
The directories are created with mask 0700 (good enough). I tried also by
manually assigning umask and reloading the pages but the cache is never
stored (and never hit).
php -m | grep hash
On Fri, 29 May 2009 13:20:13 +0200, Fabien MARTY <[hidden email]>
>> Currently I have about 12.000 cached files and sometimes (1/10)
>> takes up to 10 seconds to load the cache.
> if you have more than 1000 cache records, drop your cache and use
> "hashed_directory_level = 2" as an option for the File backend