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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:39:59+00:00 2026-05-24T06:39:59+00:00

I am running memcached on my server and when it hits 600+ req/s it

  • 0

I am running memcached on my server and when it hits 600+ req/s it becomes unstable and causes a big load of problems. It appears when the request rate gets that high, my PHP applications at random times are unable to connect to the memcache server, causing slow load times which makes nginx and php-fpm freak out and I receive a bunch of 104: Connection reset by peer errors in my nginx logs.

I would like to point out that in my memcache server I have ‘hot objects’ – objects that at times receive 90% of the memcache requests. I also noticed when so many requests hit a single object, it slightly adds a little more load time to the overall page (when it manages to load).

I would greatly appreciate any help to this problem. Thanks so much!

  • 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-24T06:40:00+00:00Added an answer on May 24, 2026 at 6:40 am

    Switch away from using TCP sockets and going to UNIX sockets (assuming you are on a unix based server)

    Start memcached with a socket enabled:
    Add -s /tmp/memcached.socket to your memcached startup line (Note, sockets disables networking support)

    Then in PHP, connect using persistent connections, and to the new memcache socket:

    $memcache_obj = new Memcache;
    $memcache_obj->pconnect('unix:///tmp/memcached.socket', 0);
    

    Another recommendation, if you have multiple “types” of cached objects, start a memcached instance for each “type” and distribute your hot items amongst them.

    Drupal does this, you can see how their config file and memcached init is setup here.

    Also, it sounds to me like your memcached timeout is set WAY to high. If it’s anything above 1 or 2 seconds, you can lock scripts up. The timeout should be reached, and the script should default to retrieving the object via another method (SQL, file, etc)

    The other thing is verify that your memcache isn’t being put into a swap file, if your cache is smaller than your average free ram, try starting memcache with the -k option, this will force it’s cache to always stay in ram and can’t be swapped.

    If you have a multi-core server, also make sure memcached is compiled with thread support, and enable it using -t <numcores>

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

Sidebar

Related Questions

I have two servers behind a load balancer. Each server is running a memcached
I have one server running memcached and another server that should be able to
In our current use of memcached, we are running into problems in a high
Just finished installing libevent(1.4.8), memcached(1.4.5), pear, and libmemcached(0.40) to my lamp server (running PHP
What are the pros and cons of having memcached running on a seperate server
Iam running WAMP server and just enabled php_memcache extension and have tried the code
What is the best MemCache solution for ASP.NET applications running in a windows server
I've a site which is running in a shared host without memcached. So, how
If I am running more than two instances of a server (using rackspace-cloud's ip
When running memcached, after a few minutes of use it starts throwing the following

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.