first time user with out of memory question

Garth Webb garth at sixapart.com
Mon Jun 12 08:42:14 UTC 2006


On Mon, 2006-06-12 at 09:48 +0200, Janning Vygen wrote:
> Am Sonntag, 11. Juni 2006 15:24 schrieb Ivan Krstic:
> > Janning Vygen wrote:
> > > and stats slab produced "out of memory" message, too. At this time it was
> > > impossible for many users to login to our web application.
> >
> > If memcached failure means your users can't log in, then you're using it
> > incorrectly.
> 
> Why? You could say same thing about disks: If disk failures mean your users 
> cant login, then you're using disk incorrectly. 

There's an important difference here; if something disappears from your
disk, its a failure.  If something disappears from your cache, then it
was probably pushed out, or the cache was cleared, or the cache was
turned off, etc, etc.

The point here is that a cache under normal conditions is non-permanent,
non-guaranteed storage with many possible ways data can disappear.
Under normal conditions, disk must be permanent and guaranteed.  Memory
under normal conditions must be guaranteed, and permanent while the
power is on.  

If you rely on memcached to store something permanently, then you risk
data loss under normal, non-error conditions.  This is why it is not a
good design to rely on a caching system as the only place data is
stored.  Any system using a cache must have permanent canonical storage
for that data.

In the case of session management, memcached will make access to your
session data faster by eliminating the need to query the disk or the DB
on every request after the session is initially created.  However, if
the cache experiences a miss or is down, the session management should
fall back to disk or DB automatically.

Garth

> session data dont needs to be saved to disk, they just needs to be store and 
> retrieved quickly and more important to me: distributed for a bunch of 
> webservers. before i used a postgresql instance to save session data but it 
> turns out to become a bottleneck by itself (not because of postgresql of 
> course but an rdbms is overkill to session data imho)
> 
> > > but i am concerned about it. As i have 3,5 GB dedicated to memached (-m
> > > 3584) it should not run out of memory.
> >
> > I recommend compiling a new binary from the Facebook branch; it contains
> > a bunch of patches that generally make memcached saner.
> 
> I don't like installing new version all the time before i didn't understand 
> the problem and i like using debian stable software as it is updated if 
> security concerns exists.
> 
> kind regards,
> janning
> 
> 


More information about the memcached mailing list