Jitendra, What are you looking to get out of memcached? I ask because starting up another instance is a bit contrary to how memcached should be used if you are looking for a cache. Remember, a cache is a copy of data placed in a quickly accessible place, it's not the primary or only copy of the data. The purpose of a cache is to stick data that is accessed frequently in a place where it can be gotten more quickly than going to the source.
The logic behind using a cache is that it takes longer to get something off of disk so you place it in memory. So, here's how you implement caching, at a very, very basic level. Pre-caching, every time a client wants data, you go to the database and get it. After caching, you look in the cache and return it from there if it's found. If it's not found in the cache, you get it out of the database, stick it in the cache and then deliver it to the client. That way, the next person that goes looking for it can find it in the cache. memcached implements an LRU algorithm to remove items from the cache when it's getting full. So an item that's been cached but never accessed again might be removed from the cache and, the next time someone goes to get data from the cache the extra step needs to be taken to get it from the database and put it in the cache again. But, since the cache has dramatically lowered your database hits, this takes a lot less time than it would have if all of the cached data wasn't in the cache. If you're looking to use memcached for some purpose other that this (a full store of all of your data, a queue), then there's a good chance memcached won't do what you want or it will not provide the benefits you're looking for. Josef On Thu, Nov 20, 2008 at 8:00 AM, Jitendra <[EMAIL PROTECTED]> wrote: > > Hi, > Thanks for the updates. > > I can't just predict the amount of data to be stored in the cache. So > I wan't to start another instance when one is full. > I found that if I make (evict_to_free=0) then I get (SERVER ERROR) > when the cache is full. > So I guess if I will get the (SERVER ERROR) then I can push the > further data to another cache. > Appreciate any suggestions on this regard. > > I saw the graphs. > They are really good. We will try to implement those. > > Regards > Jitendra > > > Aaron Stone wrote: > > Using the RRD graphs generated by this script: > > http://dealnews.com/developers/cacti/memcached.html > > > > Shouldn't be too hard to add a graph for evictions. Then you know, > > between the memory used graph and the evictions graph, when your cache > > is full and how much it is overflowing and churning. > > > > Aaron > > > > > > On Wed, Nov 19, 2008 at 1:42 AM, Jitendra <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > We are planning to implement memcached as part of our project.As the > > > data is huge, we are expecting it will go beyond the size of cache. So > > > how can we know that the cache is full, hence we can start another > > > instance of memcache. > > > > > > Regards > > > Jitendra > -- "If you see a whole thing - it seems that it's always beautiful. Planets, lives... But up close a world's all dirt and rocks. And day to day, life's a hard job, you get tired, you lose the pattern." Ursula K. Le Guin http://www.finsel.com/words,-words,-words.aspx (My blog) - http://www.finsel.com/photo-gallery.aspx (My Photogallery) - http://www.reluctantdba.com/dbas-and-programmers/blog.aspx (My Professional Blog)
