Reputation: 18325
I just installed yum install memcached
on MySQL Server. But then as service memcached status
is Running..
, what to do more as i do not think nothing is happening in performance. I think i still need to configure MySQL to work with Memcached.
Please help i'm stuck.
Upvotes: 1
Views: 912
Reputation: 21
Are you searching for this?
Mysql5.6 now support memcache integrated version plugin. If in that case, you don't need to install another memcached server. Simply install mysql 5.6. and memcached plugin.
Then.. as you can see in that page.... you can send memacached command to memcached server and memcached plugin automatically write to backup table which you want.
One thing that I think there should be more improvement is table field type. Only varchar/text/blob type can be possible( backup table field which you want to interact with memcached server... ).
PS)
I heard that memcached plugin DML throughput is amazing. but when I tried, I've only? got 30% improvement...
Upvotes: 2
Reputation: 20823
Memcached is not a MySQL performance plugin - it's commonly used as a write-though or write-back caching system - often where you need to store commonly used key/value pairs without hitting your database unless they change - thus reducing load on your DB.
Visiting the Memcached website provides useful information:
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Ultra-simplistic pseudo-code example:
Read:
if data in memcache {
// Retrieve and use
} else {
// Pull from DB, use and write to memcache
}
Or, here, Memcached describes a simple example for caching results:
Cache Results:
function get_foo(foo_id)
foo = memcached_get("foo:" . foo_id)
return foo if defined foo
foo = fetch_foo_from_database(foo_id)
memcached_set("foo:" . foo_id, foo)
return foo
end
It doesn't do anything unless you write your software/codebase to use it (usually, you write your DB functions to check the cache before hitting your DB). It's worth reading the Memcached Story of caching to understand a basic use-case scenario.
Historically, some have compared it to using HEAP or memory tables in MySQL, but it's not the same and can be distributed on many machines in a cluster and/or over a network where you have free/unallocated memory available for use - even on one server.
If you want to understand it's value at scale, then look no-further than the list of companies that use it.
Upvotes: 8