APC vs. Memcached

06 01 2008

I have been benchmarking APC and memcached to find which is the best in certain situations. Obviously APC is a much faster cache but memcached is designed for scaling across servers.

The most interesting thing I found is APC is a lot slower at storing arrays than memcached. In most cases it is still faster at reading them. For example on my test virtual server, with 4k of text memcached will do 100,000 writes in around 4 seconds whereas APC will do 100,000 writes in around 2 seconds. If I instead try to store a small array with 8 elements memcached constantly does 100,000 writes in 4 seconds, APC however takes 13 seconds! This figure seems to grow exponentially as the array grows as well. Reads speed appears to be consistent for each with around 4 seconds for 100,000 memcached reads and 0.5 seconds for 100,000 APC reads.

In the application I was working on we are storing some large arrays and some small segments of data. The smaller segments of text data also changes a lot less often than the arrays so we are storing the small text data in APC and the arrays in memcached.

Note: I am not using current versions of either APC or Memcached for this, I know both have had a couple of new releases and both have had speed improvements.


Bookmark APC vs. Memcached  at del.icio.us Digg APC vs. Memcached

Trackbacks


22 02 2008
APC vs. Memcached revisited
In my previous post on the subject I stated that Memcache was faster at storing arrays than APC was by quite a large margin.I will re-itterate that the 2 aren't really comparable in their target design. Memcached is designed as a distributed cache and as
Weblog: LinuxJedi's /dev/null
Tracked: Feb 22, 07:06

Comments

Display comments as (Linear | Threaded)
No comments

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA