Performance Testing Memcached
Earlier this week, co-workers and I did some performance testing with Memcached. We wanted to see how long it'd take to send different sizes of objects over the wire to Memcached on a remote server.
We setup a simple environment with 2 Mac Pros both running 2 x 2.8 Ghz Quad-Core Intel Xeon processors and 12GB of RAM. We used one machine as a Memcached server and one machine running an application with the addition of a new Servlet Filter. The Servlet Fitler read a size parameter and used it to set the size of the object being written and read from the Memcached server. We used JMeter to put load on the box. The following describes the load and the results.
Write Times
Write tests were performed with a single user executing 1000 sequential remove then writes.
| Size in Bytes | Time (ms.) | Min. Time (ms.) | Max. Time (ms.) | Total |
|---|---|---|---|---|
| 20000 | 1.31 | 0 | 7 | 1000 |
| 50000 | 1.834 | 1 | 8 | 1000 |
| 100000 | 2.87 | 2 | 9 | 1000 |
| 500000 | 12.641 | 9 | 283 | 1000 |
Read Times
Read tests were performed using 50 users with 1 sec. ramp times executing 100 reads each.
| Size in Bytes | Time (ms.) | Min. Time (ms.) | Max. Time (ms.) | Total |
|---|---|---|---|---|
| 20000 | 4.8414 | 1 | 375 | 5000 |
| 50000 | 18.343 | 1 | 354 | 5000 |
| 100000 | 46.181 | 2 | 415 | 5000 |
| 500000 | 137.7328 | 6 | 953 | 5000 |
During our tests, Memcached was started using the following settings:
memcached -d -m 2048 -M -p 10171 -vv
If you've done similar performance testing with Memcached, we'd love to see your results.

