memcacheD performance
Steven Grimm
sgrimm at facebook.com
Sun Jul 22 04:47:06 UTC 2007
Darpan Dinker wrote:
> Can somebody provide a ballpark response time for a get( ) under light
> load for:
> - a memcached server on the same system as the client
> - a remove server with 1 Gigabit Ethernet network
>
> I am guessing that it is on the order of 20ms and 150ms.
>
> Feedback appreciated; please include the processor, memory size and OS.
> Darpan
>
Something is seriously wrong with your configuration if you're seeing
anything like 20ms response times. It should be more like 0.5ms for
remote hosts and 0.05ms for localhost. I hope that really was just a
wild guess, not the result of actual testing.
For simple single-key "get" requests over TCP, we typically see between
400 and 500 microsecond response times. That's for a remote host over a
gigabit Ethernet, both the client and the server running Linux 2.6
kernels on 4-core 1.8GHz AMD64 boxes. If I run memcached on the same box
as my client, I see 35-40 microsecond response times.
The memory size is irrelevant (memcached uses a self-expanding hashtable
which provides constant-time lookups regardless of cache size) but the
OS matters. In our tests we found, for example, that Solaris had
somewhat higher latency than Linux on the same hardware. On the order of
50-100usec, if I remember correctly, but it was a while ago so the gap
may have closed in the meantime.
CPU type matters too: SPARC boxes had *much* higher latency than AMD64
ones, no surprise since each core of a big multicore SPARC box is
significantly slower than each core of an AMD64 box (even if the total
number of computations per second is much greater on the SPARC due to
its high parallelism.) I don't remember the numbers on that one -- maybe
some of the Sun guys can pipe up on this front?
Oh, the other thing that matters is your client. If you are using a
client in a slow language, your apparent response time will of course be
higher by some amount, but that's nothing to do with memcached per se.
Likewise, if your client has to do object deserialization when it gets a
response back, that may also affect response time depending on how fast
your language's serialization is. Though I have never encountered any
language where deserialization time would be measured in tens of
milliseconds on modern hardware!
-Steve
More information about the memcached
mailing list