Question re: General Performance Stats

Andrew B. Westmoreland andrew at
Fri Jul 20 21:19:41 UTC 2007

Hello -

We are well into testing a memcached as a means to offload read requests
from our database.  We are logging each query result to disk, and have seen
an interesting trend:

It seems that for a lot of the very small db queries, there is an increase
in latency when we pull the data from the memcache.  Whereas a simple
"select a from b where primary key ='x' " was taking ~300ms to get from our
database over a simple (and very busy) GigE switch, the memcache is running
on localhost and is seeing "query" times more like ~600ms.

We tested it on many batch runs, and it seems that using the memcache (as
configured) causes a performance hit of approximately 20%.  This is for a
CPU-bound process that uses 100% of all CPU cores in both testing scenarios.

I wanted to check with the group and see if this was typical when making the
transition.  I didn't see any mention of performance decrease in the
literature, so wanted to reach out to those of you who are using it and
working on it every day.  There is obviously real risk that the delay is due
to the way either the daemon is implemented on our systems, OR in the way we
implemented the cursor emulation in our code.

Here is a snapshot of the result of checking the stats via PHP for those of
you who might be curious:

 [localhost:11211] => Array
            [pid] => 22963
            [uptime] => 179777
            [time] => 1184966166
            [version] => 1.2.2
            [pointer_size] => 64
            [rusage_user] => 416.616664
            [rusage_system] => 772.915498
            [curr_items] => 2337
            [total_items] => 4127199
            [bytes] => 1203526
            [curr_connections] => 19
            [total_connections] => 564102
            [connection_structures] => 35
            [cmd_get] => 48904240
            [cmd_set] => 4127199
            [get_hits] => 48863204
            [get_misses] => 41036
            [evictions] => 0
            [bytes_read] => 3804455209
            [bytes_written] => 36060479069
            [limit_maxbytes] => 1073741824
            [threads] => 4

Thank you in advance for your help.  I appreciate it.

Andrew B. Westmoreland
Progressing Markets
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list