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 815755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:44:00+00:00 2026-05-15T01:44:00+00:00

I am trying to work out a good way to handle offline/down memcached servers

  • 0

I am trying to work out a good way to handle offline/down memcached servers in my current web application that are built with PHP.

I just found this link that shows an approach on how to do what I want, I think: http://web.archive.org/web/20090421075021/http://cmunezero.com/2008/08/11/consistent-memcache-hashing-and-failover-with-php/

Anyhow, it gets me confused when I start working with it and reading the PHP documention about failover with memcache. Why is offline memcache servers added to the $realInstance server pool together with the online servers?

Reading the memcache documentation confuses me even more:
http://www.php.net/manual/en/memcache.addserver.php

status

Controls if the server should be flagged as online. Setting this
parameter to FALSE and retry_interval
to -1 allows a failed server to be
kept in the pool so as not to affect
the key distribution algorithm.
Requests for this server will then
failover or fail immediately depending
on the memcache.allow_failover
setting. Default to TRUE, meaning the
server should be considered online.

Thanks,

  • 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-05-15T01:44:01+00:00Added an answer on May 15, 2026 at 1:44 am

    Basically, the way memcache distributed storage works, is that you tell it about all its servers. Then when you ask for a key (either to be stored or fetched), it creates a hash of that key. That hash then goes through an algorithm to determine which server in the pool it should go to (this is all done at the client). If you remove offline servers from the pool, that hash calculation will be different, and your entire store may be compromised (the data will still be there, but you might not be able to access it).

    The status flag lets you handle a server fail (one that didn’t just happen) in a sizable application. So, what you can do is have a configuration file for your application that lists all the servers and its status. Then, if you need to take one of the servers offline for a few minutes (or few hours), you can set that server’s status flag to false. That way, php won’t try to look for it (and hit a timeout), but the hash mapping will stay the same (So everything else will still be accessible).

    Make sense?

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

Sidebar

Related Questions

I am trying to work out a good way to run a staging server
I am trying to figure out a good way to handle the following scenario
I am trying to work out the best way to design a class that
I'm trying to work out the correct pattern to use for a Singleton that
I spent a lot of time trying to figure out a good way to
I've been trying to figure out a good and easy way to send the
I am trying to work out a way to alter the session timeout dynamically,
I've been trying to work out this problem for a good 48 hours now
I'm currently trying to build an application that inherently needs good time synchronization across
I am trying to work out a relatively clean way of comparing two types

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.