Yeah, everything David said. If this had been a real production environment where lots of file IO was happening, you could have seen a difference too. We replaced several file based caches with memcached requests for our ad server system. Those files were being loaded hundreds of times per second. The IO became a bottleneck.

Brian.
--------
http://brian.moonspot.net/

On 5/29/09 5:32 AM, David Stanek wrote:
On Fri, May 29, 2009 at 2:51 AM, Ved<[email protected]>  wrote:
I have a webpage in which I read a text file for processing. My
benchmark (ab) results show a much higher request / second than
contents stored and accessed using memcached. And also the number of
failed request is 0 when I am using disk IO where as when I am using
memcached the number keeps going higher. What could be the possible
reasons for memory IO being slower than disk IO, and the failed
requests.

I think some of your assumptions may be incorrect. If you are using
the same file in every request your OS is probably using a cached copy
in memory. It won't hit the disk every time. While memcached does
store everything in memory which is fast, it transmits data over a
socket which is slow. You are really comparing using local memory vs.
using memory on a different machine.

I use memcached to reduce hits to my database which is much slower
than memcached. Sometimes I also use it to store objects that are
expensive to create. This is just a trade off between CPU and network
access.

Reply via email to