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. -- David blog: http://www.traceback.org twitter: http://twitter.com/dstanek
