Quantcast

Zend_Cache performance

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Zend_Cache performance

mascker
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Cache performance

David Goodwin-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

enportugal wrote:

> HI,
>
> 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,
>
> Regards,
>

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.
- --
 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

iEYEARECAAYFAkofsDQACgkQ/ISo3RF5V6aopQCg+FHwvDVQv3ZFkH/24sDtAIhR
a9EAn3ifJWgQ8pXFoF7IPA0/sJ9TSxoi
=uBmw
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Cache performance

vince.
In reply to this post by mascker
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.

On Fri, May 29, 2009 at 12:37 PM, enportugal <[hidden email]> wrote:

HI,

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,

Regards,

--
View this message in context: http://www.nabble.com/Zend_Cache-performance-tp23777010p23777010.html
Sent from the Zend Framework mailing list archive at Nabble.com.




--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Cache performance

Mary Nicole Hicks
In reply to this post by mascker
enportugal wrote
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).

enportugal wrote
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.



enportugal wrote
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Cache performance

Fabien MARTY
In reply to this post by mascker
> [...]
> Currently I have about 12.000 cached files and sometimes  (1/10) Zend_Cache
> 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

Regards

--
Fabien MARTY
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Cache performance

Armand Brahaj
Maybe I am a little bit out of the topic,

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
0 (default).
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
any more.
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).

ZF 1.7.5
PHP 5.2.9
php -m | grep hash
hash

Regards,
Armand



On Fri, 29 May 2009 13:20:13 +0200, Fabien MARTY <[hidden email]>
wrote:
>> [...]
>> Currently I have about 12.000 cached files and sometimes  (1/10)
>> Zend_Cache
>> 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
>
> Regards
Loading...