Cache::Memcached question

Brad Fitzpatrick brad@danga.com
Mon, 3 May 2004 09:47:57 -0700 (PDT)


That's not desirable behavior when you have 40 memcached servers.  It's
okay (and expected) for hosts to be down.



On Mon, 3 May 2004, Joachim Bauernberger wrote:

> Hi,
>
> ... just had look at Memcached.pm ...
>
> From what I could see, the connections aren't made when calling
> new Cache::Memcached
> ... which would explain why I didn't get the errors (silly me).
>
> In order to get what I want I modified Memcached.pm and simply called
> sock_to_host in set_servers() for every server:ip in @list
>
> Think this is the correct way since the sockets are kept global in the
> %cache_sock hash, no?
>
> Regards,
> ~/joachim
>
>
> On Monday 03 May 2004 12:37, Joachim Bauernberger wrote:
> > Hi,
> >
> > How do you guys check if the connection to memcached was successful?
> > No matter what I put into $config_memcachedhost below and no matter if
> > memcached is running, the following would always result in a defined $memd
> > object returned. Also $@ is empty.
> >
> > How do you trap errors in connection setup?
> >
> > sub init_memcached
> > {
> >     eval {
> >         $memd = new Cache::Memcached {
> >         'servers' =>  @config_memcachedhosts ,
> >         'debug' => $config_memcached_debug,
> >         'compress_threshold' => $config_compress_threshold,
> >         }
> >     };
> >     die localtime()." Error connecting ($!) Cache::Memcached: $@\n" if ($@
> >
> > || !defined ($memd));
> >
> >     return;
> > }
> >
> > Thanks & best regards,
> >
> > Is there a cvs for this too?
> > Brad wanted to do something like $memd->errstr() IIRC in future releases.
> >
> >
> > Thanks & Best regards,
> > ~/joachim
>
> --
> Web: http://www.bauernberger.org/
>
>