> You say the normal way to use memcached. But Session is something special. If > the web lose the session data. It's doesn't Matter. And session data were > userd > frequently. So The best solution is just put the session data in memcached. > I didn't said "don't use memcached at all", I said "don't rely on memcached as a persistent storage".
In any case, if web app lose session data in same time the user works with app, it's not too good. > We have one big server that serves our rails web application. > > > > I'm new to using memcached and I'm planning to use it for storing > session > > data, I mean as a session store. What happens if memcache consumes too > much > > memory? Should I monitor the memcached process now and then and > restart > it? > > Or, can I set memory limits for it so that it won't exceed the > allocated > > space? > > > You shouldn't use memcached as a persistent storage. > Your issue as a rule implemented in the following maner: > - store the session's data in the persistent storage (DB, files etc.) > - cache the session's data in the memcached > > All the read requests should go to the memcached. If there is an empty > result - go to the persistent storage and cache the result in the > memcached. > All the write requests should update the both persistent storage and > memcached. > >
