PHP Daemon marks Memcache as failed every few days

Iain Bapty ibapty+memcached at
Tue May 22 09:01:13 UTC 2007

Dear All,

I've developed a PHP Daemon application which retrieves data from a web
service every 5 seconds and saves the data using Memcache. The application
has been in development for a week with the daemon running solidly for
nearly 7 days. Over those 7 days, the daemon has terminated a few times due
to a loss of connectivity to the Memcache.

Notice: Memcache::set(): marked server 'localhost:11211' as failed in
> D:\AJAX3\daemon.php on line 44

The following line is used to add data to the Memcache.

$memcache->set('Graph', $oGraph, false, 10)

Note that the 5-second loop does not reconnect to Memcache on each
iteration. An initial connection is made when the daemon is started and this
connection is reused for each loop. Would it be better to reconnect to
Memcache every 5 seconds?

The Memcached is running as a Windows service and there isn't anything in
the Windows Event Viewer to suggest that the daemon has terminated.

The error handling in the daemon is currently being revised so it will
gracefully handle this situation and reconnect to the Memcache. However, I
am planning on relying on the Memcache so any comments on how to debug this
issue would be very much appreciated.

I'm running:

PHP 5.2.1
Memcache extension taken from
Memcached 1.2.1 (
Running on Windows XP

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list