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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:53:58+00:00 2026-06-09T23:53:58+00:00

I am using memcache(not memcached) and I might have 10000 request at same time

  • 0

I am using memcache(not memcached) and I might have 10000 request at same time hitting cache . Which might cause race condition so I used this code http://terrychay.com/article/keeping-memcache-consistent.shtml to obtain locks and than set the key .

Now from logging I saw that while one request A is waiting on cache other request B might complete fetching data and puts in to cache so there is no point of request A to wait and overwrite the data .

So I thought one solution is : while a request is waiting for lock it will check if the data was there at key . If its there than return data from key instead of updating it . Can any one else think of any suggestions ? Will checking for key while waiting for lock blow up memcache server ?

  • 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-09T23:54:00+00:00Added an answer on June 9, 2026 at 11:54 pm

    I don’t think it’s worthwhile tinkering with the lock acquisition code to much. Once you have the lock, you can simply do a get and if the data is there, clear the lock and simply return the data without hitting the database.

    Doing this should also reduce the overall waiting time.

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

Sidebar

Related Questions

I am using Memcache (Not memcacheD) . If I have 10 memcache servers and
I'm trying to have atomic increase-or-create operation in Django cache. I'm using memcache as
I am using memcached (gem memcache-client ) in my application, but I want to
I have not tried yet, as I would rather not spend time setting up
I have a very weird problem, when storing my session in Memcached. From time
I use the cache-money gem for transparent usage of Memcached. Using the supplied config
I have this project, called Memcached.Js , which is a port of Memcached server
I'm using a mysql memory table as a way to cache data rows which
I saw some people in a development team using Memcached to cache database results,
I'm using Ruby 1.8.6 and have a class ( not an ActiveRecord class) that

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.