PHP Daemon marks Memcache as failed every few days

Iain Bapty ibapty+memcached at gmail.com
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
http://pecl4win.php.net/ext.php/php_memcache.dll
Memcached 1.2.1 (http://jehiah.cz/projects/memcached-win32/)
Running on Windows XP

Thanks,
Iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070522/6d535592/attachment.html


More information about the memcached mailing list