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

  • Home
  • SEARCH
  • 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 6022409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:51:13+00:00 2026-05-23T03:51:13+00:00

For a high traffic web site we are planning to scale up to use

  • 0

For a high traffic web site we are planning to scale up to use 2 web servers in a HA setup.

One issue we will need to tackle is the management of PHP sessions.

The obvious answer is to move session handling to the DB which is easy and example code is widely available ton the internet.

On the other hand we are aware of the benefits of memcached but once a memcached node fails, users on that node will lose their session.

So we are thinking of implementing a setup where sessions are handled in memcached by default but also written in the DB. When we get a memcached MISS we would try to also retrieve it from the DB.

Does the above make sense and are there any implementation examples you are aware of?

thanks in advance

  • 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-23T03:51:14+00:00Added an answer on May 23, 2026 at 3:51 am

    I refer you to Dormando’s oft-cited explanation of how to store sessions in MySQL with memcached caching. The original LiveJournal post is more wordy but more thoroughly explains why storing sessions in memcached only is a bad idea.

    In short:

    • Read session data from memcached first, look in MySQL on a cache miss.
    • Write session data to memcached on every update.
    • Only write to MySQL if cache data hasn’t been synced for 120 seconds or so.
    • Run a periodic script that checks MySQL for expired sessions. For every expired session, update from memcached and only expire the ones that are truly expired.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an online store with Magento. The site will be high traffic and
We currently have a high traffic web site, so are relatively comfortable with web
We have a large news-oriented site that has high web traffic. The architecture is
Consider the creation of high traffic PHP web-site with many parallel users. Which is
I have a high traffic website and I need make sure my site is
I have a high-traffic site that records web hits in a table, Hits. There's
Our website is currently experiencing high volume download traffic. It will soon exceed the
For example on a high traffic web server. To reduce problems when switching a
I've been having performance issues with a high traffic ASP.NET 2.0 site running on
im building a high traffic asp.net webforms site. I have componentized all the urls

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.