MySQL server + memcached: CPU usage very low, but Memory quite high

183 views
Skip to first unread message

p23

unread,
Mar 25, 2010, 3:46:47 AM3/25/10
to memcached
Hi,
I've 3 server running apache,MySQL and memcached.
i monitor the CPU+Memory usage of MySQL.
it show when i'm using MySQL with memcached (dedicated server), the
cpu usage is very low but the memory quite higher a little bit. It's
not much, but i'm wonder why it goes higher (than MySQL with memcached
disabled) since items are already cached and memcached reside in
dedicated server. I run it many times and it shows the same result.

MySQL + query cache:
Mem: 45.0 %
Cpu: 19.0 %

MySQL + memcached:
Mem: 47.0 %
Cpu: 2 %

Thanks in advance :)

Jérôme Patt

unread,
Mar 25, 2010, 7:48:54 AM3/25/10
to memc...@googlegroups.com
p23 schrieb:

I don't know, how you are using memcached exactly, but if you are using memcached as an
object-cache for your application ist quite obvious, that a memcached needs more memory to
store needed informations.

In general I would advice you to be very carefull running multiple instances of memory and
connection (yes, a connection to localhost is still a connection) consuming entities on
one machine. In various scenarios this will produce unpredictable behavior.

Kind regards,

J�r�me

Henrik Schröder

unread,
Mar 25, 2010, 8:25:28 AM3/25/10
to memc...@googlegroups.com
Why bother? 2% more memory is within the error margin, it could be virtually anything that causes your MySQL process to use a little bit more memory in the other case, maybe your test case is a little bit different, maybe the new access patterns cause a different usage on the internal buffers, maybe it's just random chance.

The important thing is that you consume 1/10th of the CPU with caching, which means the whole thing works as it should and takes load off your MySQL server.


/Henrik

To unsubscribe from this group, send email to memcached+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

p23

unread,
Mar 25, 2010, 8:48:45 AM3/25/10
to memcached
> In general I would advice you to be very carefull running multiple instances of memory and
> connection (yes, a connection to localhost is still a connection) consuming entities on
> one machine. In various scenarios this will produce unpredictable behavior.

> Why bother? 2% more memory is within the error margin, it could be virtually
> anything that causes your MySQL process to use a little bit more memory in
> the other case, maybe your test case is a little bit different, maybe the
> new access patterns cause a different usage on the internal buffers, maybe
> it's just random chance.
>
> The important thing is that you consume 1/10th of the CPU with caching,
> which means the whole thing works as it should and takes load off your MySQL
> server.

Thanks for your advice and opinion, ''l figure it out more :)

Laurent Laborde

unread,
Mar 25, 2010, 8:50:33 AM3/25/10
to memc...@googlegroups.com

Using memcached on the same server as mysqld, and with a single
instance, is not really usefull.
But you have the ability to use memcached on a 2nd server, or on a
cluster of server, this is the real advantage of memcached.
When you need more memory cache, just add a new server, no need to buy
an insanly expensive server with 64 or 128GB of memory :) :)

--
Laurent "ker2x" Laborde
Sysadmin & DBA at http://www.over-blog.com/

Reply all
Reply to author
Forward
0 new messages