Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8988607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:02:27+00:00 2026-06-15T22:02:27+00:00

According to https://github.com/mperham/dalli , we can configure multiple Memcache servers. But I’m not sure

  • 0

According to https://github.com/mperham/dalli, we can configure multiple Memcache servers. But I’m not sure how it works.

Assume that we’re using a memcache cluster with two servers: memcache1(box1) and memcache2 (box2).

  • User A and user B share a same resource.
  • User A login and read the shared resource cached in box1.
  • User B login and read the shared resource cached in box2.
  • User A updates the shared resource and expires the cache on box1
  • User B does not see the updated resource and still get the cached on in box2.

It’s my understanding so far, I’m not sure how the cache expiration works in cluster environment.
Especially, when we want to eagerly expire the cache, will it expire on all boxes?

Given we have a same configuration like this in TWO rails servers:

config.cache_store = :dalli_store, 'memcache1', 'memcache2'

How do you think about this use case?

Thanks for your all interest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:02:28+00:00Added an answer on June 15, 2026 at 10:02 pm

    Memcached sharding is sharding, not replication. That is, there isn’t a copy of the data on each server; the data is split up between servers.

    Keys will only ever exist on one server. Dalli passes keys through a distribution algorithm to determine which server will own a given key, then passes messages to that server. The same keys will not exist on multiple servers, so you don’t have to worry about expiring the keys on both of them at once. If you expire the key, it will be expired on the single box that it lives on.

    If both users are requesting data via the same cache key, then expiring that cache key will invalidate it for both of them; you don’t have to worry about User 1 getting routed to Box 1, and User 2 getting routed to Box 2, because a given key will always map to a given server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to https://github.com/technomancy/leiningen/blob/master/sample.project.clj I can attach a :init inside of a :repl-options. However, when
I'm going according to the documentation at https://github.com/felixge/node-airbrake But when I try it, I
According to the documentation here: https://github.com/playframework/Play20/wiki/AssetsGoogleClosureCompiler it says: Any JavaScript file present in app/assets
I've been trying to build live555 according to this guide: https://github.com/boltonli/ohbee/tree/master/android/streamer/jni as well as
According to the documentation found in http://ask.github.com/celery/userguide/routing.html#manual-routing i can pass a queue parameter to
I'm using gem rapns (https://github.com/ileitch/rapns) on my rails app. According to rapns doc, I
I've installed social_stream according to the README ( https://github.com/ging/social_stream ) and it works fine,
(A minimal non-compiling example can be found at https://gist.github.com/4044467 , see more background below.)
I installed rbenv according to the instructions at https://github.com/sstephenson/rbenv#section_2 Restarting my shell at point
I use gem sunspot_rails https://github.com/outoftime/sunspot I did everything according to the instructions on http://railscasts.com/episodes/278-search-with-sunspot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.