Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My application seems to be having issues with memcached not stopping.

I'm using php, and have specific keys expiring after every hour. However those keys & values are not repopulating anymore.

When I run:

/etc/init.d/memcached restart

I get the following:

Stopping memcached:                                        [FAILED]
Starting memcached:                                        [  OK  ]

I have to run a killall memcached for memcached to stop. I then run a restart and everything is fine.

I'm not exactly sure what is causing this, but I need memcached to be restarting every hour. Where should I be looking to find out what is causing this?

share|improve this question
You need memcached to restart once an hour? Sounds like you've got some other problem you're trying to inelegantly solve, too. You can set an expiration time for memcached keys when you set them... – ceejayoz Apr 4 '13 at 15:03
Perhaps I was unclear, but the expirations are set once an hour in the php code. But the keys aren't being reset is the issue I'm trying to solve. Memcached doesn't need to be reset, just the keys/values. – Jhouse153 Apr 4 '13 at 15:08
Inelegance is not the question there... but expiring all of a cache at one point in time is a good way to stampede the application under heavy load. – rackandboneman Apr 4 '13 at 15:16
I won't comment on the why, but have a look at the PID recorded in /var/run/memcached (or similar) then compare it to the running PID of memcached. – NickW Apr 4 '13 at 15:45
Thank you for responding to the question Nick. That is one thing I've noticed. The is empty, I'm assuming it shouldn't be. – Jhouse153 Apr 4 '13 at 15:54

For me it was because I initially ran memcached -d manually.

Then later when I tried to run service memcached restart/stop, the stop command would fail. After killing the process manually service memcached restart/stop worked as expected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.