[PHP] APC caching keys.
I have started making use of the APC extension to cache opcodes, etc now I'm also trying to cache the output of some sql queries and I want to use a hash of the query as key to store/fetch the value e.g: apc_fetch(md5($qry)) does anyone know of a good reason (including performance reasons) for not using a hash in such a way? tia & rgds, Jochem PS - apc is very nice! I just haven't been able to get it to work on 5.1 (last tried on 5.1RC5dev) - has anybody else had luck getting apc to work with 5.1? did you have to do anything special? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] APC caching keys.
> I have started making use of the APC extension to cache > opcodes, etc now I'm also trying to cache the output of some > sql queries and I want to use a hash of the query as key to > store/fetch the value e.g: > > apc_fetch(md5($qry)) > > does anyone know of a good reason (including performance > reasons) for not using a hash in such a way? Wouldn't apc_fetch($qry) do much the same thing? Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC caching keys.
Jared Williams wrote: I have started making use of the APC extension to cache opcodes, etc now I'm also trying to cache the output of some sql queries and I want to use a hash of the query as key to store/fetch the value e.g: apc_fetch(md5($qry)) does anyone know of a good reason (including performance reasons) for not using a hash in such a way? Wouldn't apc_fetch($qry) do much the same thing? generally the md5 sum of $qry is shorter than $qry Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC caching keys.
On Wed, Nov 16, 2005 at 04:32:29PM +0100, Jochem Maas wrote: > I have started making use of the APC extension to cache opcodes, etc > now I'm also trying to cache the output of some sql queries and I want to > use a hash of the query as key to store/fetch the value e.g: > > apc_fetch(md5($qry)) If you are using mysql i would use the SQL_CACHE flag, it will eliminate the need for you to manage the cache. > > PS - apc is very nice! I just haven't been able to get it to work on 5.1 > (last tried > on 5.1RC5dev) - has anybody else had luck getting apc to work with 5.1? did > you have > to do anything special? The last version of php5.1 i have installed APC on is a cvs snapshot of around Feb 4 2005 11:49:05. Nothing special was needed. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC caching keys.
On 19 Nov 2005, at 04:07, Curt Zirzow wrote: If you are using mysql i would use the SQL_CACHE flag, it will eliminate the need for you to manage the cache. You don't necessarily need to us the SQL_CACHE flag in queries - you can just turn on the query cache globally using query_cache_type=1 in your my.cnf. Otherwise I quite agree - and MySQL has the huge advantage that it will work very nicely across multi-server deployments: http://dev.mysql.com/doc/refman/5.0/en/query-cache.html The last version of php5.1 i have installed APC on is a cvs snapshot of around Feb 4 2005 11:49:05. Nothing special was needed. The current 3.0.8 release of APC is broken in PHP 5.1.0-dev if you ever use __autoload. It will be fixed in 3.0.9 (and is fixed in CVS), though Rasmus implied that 3.0.9 is waiting until 5.1 release. Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] | http://www.synchromedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC caching keys.
Marcus Bointon wrote: On 19 Nov 2005, at 04:07, Curt Zirzow wrote: If you are using mysql i would use the SQL_CACHE flag, it will eliminate the need for you to manage the cache. You don't necessarily need to us the SQL_CACHE flag in queries - you can just turn on the query cache globally using query_cache_type=1 in your my.cnf. Otherwise I quite agree - and MySQL has the huge advantage that it will work very nicely across multi-server deployments: http://dev.mysql.com/doc/refman/5.0/en/query-cache.html The last version of php5.1 i have installed APC on is a cvs snapshot of around Feb 4 2005 11:49:05. Nothing special was needed. The current 3.0.8 release of APC is broken in PHP 5.1.0-dev if you ever use __autoload. It will be fixed in 3.0.9 (and is fixed in CVS), though Rasmus implied that 3.0.9 is waiting until 5.1 release. I guess I'll have to try a build myself a copy of APC from cvs - operative word being try :-/ having said that I don't use __autoload() - I did but it was just a PITA - but I wonder if the segfault still occurs if there are situations that occur (missing class[es]) that cause the engine to check-for/try-to-run __autoload() (even though it doesn't due to the fact that its not defined)?? thanks for the feedback! Marcus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC caching keys.
On 21 Nov 2005, at 10:54, Jochem Maas wrote: having said that I don't use __autoload() - I did but it was just a PITA - I thought it was a good idea for a while... One major irritation with it is that with standard error reporting you can't tell where a missing class can't be found from (it is reported as having come from your __autoload function). You need a stack trace to figure out where the original problem occurred - xdebug works a treat (but it won't mix with APC). Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] | http://www.synchromedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php