Thanks David for your reply but what I mentioned are not my assumptions 1. memcached is installed on the machine where my file is so that takes care of your concern ( memory on a different machine ). 2. I am not just reading a single file everytime. I have 3 data files that I access in the script (system may be caching files in memory) 3. Even if the files are not changing does it mean that disk cache is faster than memcached? that too an extent of disk cache being almost 50% faster than memcached.
I am sorry, but I don't think your explanation addresses my concerns. Ved On May 29, 3:32 pm, David Stanek <[email protected]> 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. > > -- > David > blog:http://www.traceback.org > twitter:http://twitter.com/dstanek
