Is memcached really faster than MySQL on very simple query?

Paul T pault12345 at yahoo.com
Thu Jul 13 18:37:29 UTC 2006


> howard chen wrote:
> > seems MySQL is quite efficient in handling simple
> query?

 The provided test gives :

 10000 / 13 = 770 hps ( hits per second )

 (which does not mean that this low number is the
actual throughtput neither of mysql nor of memcached,
because he test is sequential. It 'gives the right
idea', though).

>  From Perl, MySQL used to be about twice as fast as
> Memcached on simple 
> queries.  Then Brad tweaked the client code a bit,
> and it's about on par 
> now, as you saw in your test.  I suspect this is
> still mostly because of 
> the client code -- the server is probably doing less
> than MySQL, so it 
> should be faster, but DBI/BDB::mysql are written in
> C and 
> Cache::Memcached is not.  If that long-rumored XS
> client ever comes out, 
> I expect it will be faster than MySQL every time.

 Absolutely. 

 XS memcached client should (maybe significantly)
improve the numbers for the case where:

 1. cached values are tiny ( <2K )
 2. you need to access the cache real fast from
scripting language ( == memcached access consumes a
considerable portion of your script business logic )

 Seriosly, how many people use memcached with both 1
and 2 in place? It would *not* be wise to use
memcached for that case, actually. 

 If there is anybody on the list who really needs 1+2,
then you are welcome to email me "request for beta"
and in a few weeks I should be able to give you access
to some (future opensource) component that gives
factor of 10 better numbers for this case. As a matter
of fact, a single email would help me to convince the
management that there is some audience for this
component and open sourscing it would make sense.

Rgds.Paul.

> - Perrin
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the memcached mailing list