← Back to team overview

launchpad-dev team mailing list archive

Re: memcache, responsiveness and load {short story, lets turn memcache off}

 

On 5 August 2010 19:08, Stuart Bishop <stuart.bishop@xxxxxxxxxxxxx> wrote:
> On Thu, Aug 5, 2010 at 2:27 AM, Jeroen Vermeulen <jtv@xxxxxxxxxxxxx> wrote:
>> On 2010-08-04 19:10, Robert Collins wrote:
>>
>>> For clarity, I'm proposing removing all the uses of it that users are
>>> noticing (and thus complaining about) - not removing the facility from
>>> the datacentre: memcached is a good tool and its good that we have it
>>> available.
>>
>> If the main problem is "user changes something but doesn't see the change
>> reflected in the page," that's the same problem we have with replication
>> lag.  Couldn't we solve that in the same way, by having a user bypass
>> memcached for a while after a POST?
>
> We could, yes. It would be an interesting experiment, and we could get
> an overall measurement of the downside by comparing the cache hit
> rate.
>
> It wouldn't be a large hack - just make all IMemcacheClient.get
> requests fail if there has been a POST in the last x seconds (10
> seconds? Good a guess as any - I would go for 5. Although we might
> have to go for 5 + hard_timeout depending on how the plumbing fits
> together). It will not solve the problem, but it might hide it to the
> extent of making it unnoticeable at the cost of our cache hit rate.

Thinking back to cases where I hit this, I don't think it's enough. I
went through and updated a bunch of bugs, then minutes later came back
and refreshed the milestone page.  If we wanted to take this course we
could say "never accept cached values older than the last time the
current user changed the database".  (Assuming that memcached does let
you send an if-not-modified-since request to the cache; perhaps it
doesn't.)

>> (Yeah, I know, slower pages.  But set the duration of that special state to
>> 10 seconds and have memcached invalidate after 10 seconds, and we'll still
>> get effective "slashdot protection" while hiding all unwanted caching
>> effects at minimal cost to the user.)

It would be useful to establish that memcached does in fact give us
"effective slashdot protection".  If we used a web load generator to
send (oh I don't know, what's typical?) 10 requests/second to a
particular bug page, what happens?  It seems like it ought to help,
but it would be nice to test it on edge.  On the other hand a lot of
random casual visitor traffic may be anonymous, and might be served
from squid anyhow?

-- 
Martin



Follow ups

References