NON VOLATILE MEMORY, PHP extension

howard chen howachen at gmail.com
Thu Jan 11 10:36:02 UTC 2007


On 1/11/07, Roberto Spadim <roberto at spadim.com.br> wrote:
> maybe :)
>
> i was checking with php
> mysql_query('select * from table where
> hash_key='hash_value'');mysql_fetch_row();mysql_free_result();
> is faster than
> memcache_get(server,hash_value);
>

you are right, mysql query with qcache  +  unix socket is faster than
memcached + tcp (in all my tests)

reason:

1. mysql using socket has less overhead than tcp
2. mysql can only store plain data type, no conversion  (i.e. can you
fetch an array directly from mysql's row, how about memcached? think
about how memcached deal with it)

but you might don't want to rely on qcache:

1. qcache will be cleared if table is being updated
2. qcached is not distributed

if you just want fast local cache, i would recommend

1. apc
2. eaccelerator

rather than memcached or mysql


More information about the memcached mailing list