Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread Peter J. Holzer
On 2010-03-12 17:07:25 -0800, dormando wrote: > Now, it should be obvious that if a user session has reached a point where > it would be evicted early, it is because you did not have enough memory to > store *all active sessions anyway*. The odds of it evicting someone who > has visited your site *

Re: Memcache as session server with high cache miss?

2010-03-13 Thread TheOnly92
Well, before I come consulting you guys, I have asked the same question at Stackoverflow and someone pointed it out that both servers need to have the same memcached pool IP order, so we fixed that. Our pecl/memcache version is 3.0.1, it's not too old? I haven't checked the error logs yet so I can'

Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread Adam Lee
If your goal is only to make memcached into a reliable datastore, then I think you are perhaps going about it in the wrong way. The memcached server is extremely well written and tuned and does it's job incredibly well and very efficiently. If you want to ensure that it is deterministic, I think

Re: Memcache as session server with high cache miss?

2010-03-13 Thread Adam Lee
Given the behavior and the high miss rate, I really have to think that something doesn't match between your two servers. Either the server configs are different or they're trying to get different keys-- there's no reason, otherwise, that data would appear to be there for one of them but not for th

Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread dormando
> Cool. Would it be possible to make this number configurable via a cmd line > switch? You really don't want to mess with this value. It will bring you the absolute opposite results of what you expect. Memcached does this search while holding a global mutex lock, so no other threads are able to a

Re: Memcache as session server with high cache miss?

2010-03-13 Thread dormando
>From the looks of it, you're not evicting anything. Which means memcached isn't forgetting about anything you're telling it. For some other reason your sessions are not being found. >From your description of the problem (sometimes logged in, sometimes not), along with the high miss rate on memcac

Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread Martin Grotzke
Hi Carlos, thanx for your answer! I'm already using this option (-M - return error on memory exhausted (rather than removing items)), it's working fine. Cheers, Martin On Sat, Mar 13, 2010 at 3:03 PM, Carlos Alvarez wrote: > On Fri, Mar 12, 2010 at 8:56 PM, Martin Grotzke > wrote: > > Hi Br

Re: Memcache as session server with high cache miss?

2010-03-13 Thread TheOnly92
Webserver1: http://paste2.org/p/715491 Webserver2: http://paste2.org/p/715492 Situation: 1. User logs in. 2. User clicks somewhere (still logged in) 3. User clicks on another placed and gets redirected to the home page (appears logged out for this page) 4. Refreshes and able to access the page aga

Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread Martin Grotzke
Hi Dormando, thanx for this great explanation! On Sat, Mar 13, 2010 at 2:07 AM, dormando wrote: > > - On read, if a key is past its expiry time, return its memory to the slab > pool and return NOT FOUND > - On write, try to allocate new memory: > * From the slab's pool of free memory. > * ...

Re: How to get more predictable caching behavior - how to store sessions in memcached

2010-03-13 Thread Carlos Alvarez
On Fri, Mar 12, 2010 at 8:56 PM, Martin Grotzke wrote: > Hi Brian, > you're making a very clear point. However it would be nice if you'd provide > concrete answers to concrete questions. I want to get a better understanding > of memcached's memory model and I'm thankful for any help I'm getting he