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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:10:13+00:00 2026-05-28T04:10:13+00:00

I have a website that is being served by nginx and django. My staging.py

  • 0

I have a website that is being served by nginx and django.

My staging.py contains CACHE and middleware settings correctly. You can take a look at nginx.conf and the nginx conf file related to the site. I have confirmed that memcached is running through ngrep -d any port 11211.

I turned on caching for the whole site, and wanted to see the performance by doing ab -n 1000 -c 10 http://site.com

With caching turned off, I get:

Concurrency Level:      10
Time taken for tests:   10.276 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      11695000 bytes
HTML transferred:       11559000 bytes
Requests per second:    97.32 [#/sec] (mean)
Time per request:       102.759 [ms] (mean)
Time per request:       10.276 [ms] (mean, across all concurrent requests)
Transfer rate:          1111.43 [Kbytes/sec] received

With caching turned on, I get:

Concurrency Level:      10
Time taken for tests:   12.277 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      11695000 bytes
HTML transferred:       11559000 bytes
Requests per second:    81.45 [#/sec] (mean)
Time per request:       122.771 [ms] (mean)
Time per request:       12.277 [ms] (mean, across all concurrent requests)
Transfer rate:          930.26 [Kbytes/sec] received

My website is a blog that is pulling posts from a database – nothing exotic.

I’d be grateful if someone could let me know why the site is actually slowing down with memcached. You can see that the “Requests per second” actually drops when I use memcached!

However, running memcached-top gave me no hits when I ran ab (though the read and write counters went up during the test). I have memory available and memcached is not hogging up memory.

EDIT
I ran memcached -vv and got some results. You can see that the the memcached prints out a “STORED” the first time, and then does not seems to send it from the cache (not sure about this). Now I am even more confused. Perhaps the memcached & the django interface is working, but the end result is that it better off to not run memcached?

  • 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-28T04:10:14+00:00Added an answer on May 28, 2026 at 4:10 am

    Trewq, whole lot of different things could be going wrong. You said your machine isn’t paging but get requests don’t come back even though memcache STORED the result.

    My theories: too short of timeouts, bad driver, and possibly wrong CPU arch (x86 vs _64)

    Timeouts

    Usually in the -vv output ( might be -vvv ) the SET line will have syntax like command, key, value, and a timeout. Very small timeout’s might be the problem with memcache storing and then almost immediately flushing the value out.

    <command name> <key> <flags> <exptime> <bytes> [noreply]\r\n – https://github.com/memcached/memcached/blob/master/doc/protocol.txt

    Driver

    Also, there might be an issue with the memcache driver/api you’re using as mc should never block that long. You can check your memcache service state by doing something like this http://code.google.com/p/memcached/wiki/NewConfiguringServer#Inspecting_Running_Configuration before and after doing a bechmark run.

    Key auditing

    A while back I wrote the script in this question Setting smaller buffer size for sys.stdin? to audit the output of memcache -vv to see how balanced GETs were to SETs. It’s been a while but I believe it might useful to you with some fixes.

    It’s not mentioned in the wiki for stat but there are stat values to help you figure out if your cache is balanced – https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L409

    Super ideal is 9/10 requests are hits to 1 miss, reality is more likely 6/10 hits to requests, and anything below 60% is wasting memory.

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

Sidebar

Related Questions

I have a rather simple informational website that's being run by Django. Its' pages(views)
i have a website that is being hosted on www.webhost4life.com. Its a basic asp.net
So basically I have website that has names of cities that can be checked
I have been using the 'Web Site Administration Tool' that you can bring up
I have a website that is mainly based on JavaScript. It uses a REST
I have a website that is mirrored cross two sub-domains. So I have separate
I have a website that logs in using an STS, then gets a delegated
I have a website that in a few months is going to have traffic
I have a website that includes a few loading Gifs that spin while certain
I have a website that runs fine on IE10 Consumer Preview, Chrome, and Firefox

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.