Is memcached really faster than MySQL on very simple query?

Andrew Harbick aharbick at aharbick.com
Fri Jul 14 19:12:20 UTC 2006


Howard,

I wonder if we're niggling over details that really don't matter.

You're measuring client-side performance and the difference between your 
two options is .2ms/call.  Even if you made 1000 of these client-side 
calls per page you're looking at 2ms of additional overhead.  Is it 
worth the engineering work to eliminate that overhead?  My bet is that 
you're spending more hardware resources on other things that should be 
worked on first.

Andy

howard chen wrote:
> On 7/13/06, Jamie McCarthy <jamie at mccarthy.vg> wrote:
>>
>> MySQL is a centralized bottleneck, is hard/expensive to add
>> performance to, and has highly nonlinear performance
>> characteristics.  Memcached is decentralized, cheap/easy to add
>> performance to, and runs very close to O(1).
>>
>> So the big win for memcached is not that it is faster than mysql,
>> but that it takes load off mysql.
>>
>> If you can move 1000 simple queries per second from your (expensive)
>> mysql replicator slave network to your (cheap) memcached network,
>> then even if those queries run slightly slower (which I doubt), you
>> will be ahead.  Your mysqls are freed up to do the complex queries
>> only they can do, they will run those lengthy queries faster which
>> will be a net gain in performance for your application, and they
>> will have more breathing room before the load wedges them up and
>> effectively takes your whole application down.
>>
>> Is there an FAQ yet?  I nominate this as one entry :)
>> -- 
>> Jamie McCarthy
>> http://mccarthy.vg/
>> jamie at mccarthy.vg
>>
> 
> 
> Hi all,
> 
> I think no people questioning about the practical use of Memcahed (we
> all know about it, otherwise there is no point in sending to this ML), but
> just consider the followings...
> 
> 1. MySQL is a complete, heavy, bulky DBMS, in the above example, in every
> loop, the script prepare the SQL statement, retrieve data from disk 
> (prepare
> statement can't have query cache!!), and it is still faster then mencached
> where data are being stored in memory, and we believed that memcached is an
> optimized, lightweight server.
> 
> 2. If the bottom-neck is due to the Perl Client, then, are there any
> faster client (written in C) for memcached? People not aware of this slow
> down or they just satisfied with this?
> 
> the purpose of my email is want to help memcached be a better software, no
> to challenge its usefulness...
> 
> 
> Regards,
> Howa
> 


More information about the memcached mailing list