problems with PHP and memcached
DJ Matlock
jmat@shutdown.net
Tue, 8 Jun 2004 10:53:00 -0400
This is a multi-part message in MIME format.
--------------Boundary-00=_D0WZ40MWKGMMYJ0CCJD0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Another benefit I just remembered (on why I like doing it myself):
I was finding that one of the PHP scripted clients wasn't always picking the
'right' server because of the way it handles large number/integers. It
would randomly pick completely different servers than the Perl and Python
clients would. By being able to roll my own 'pick' function, I can make
sure my PHP scripts will pick the same servers as the Perl and Python
clients will.
Just think of the memcache.so client as a low level replacement for the PHP
script clients - you really shouldn't "use it raw", but wrap it inside of
your own memcache class.
And it still blows away the scripted versions.
PS, Antony: the latest release fixed all the problems I was having with
PHP5; I'm no longer getting the weird segment violations in Apache2.
Thanks. :)
J
-----Original Message-----
From: memcached-admin@lists.danga.com
[mailto:memcached-admin@lists.danga.com] On Behalf Of Steve Simitzis
Sent: Tuesday, June 08, 2004 2:32 AM
To: Antony Dovgal
Cc: memcached@lists.danga.com
Subject: Re: problems with PHP and memcached
On 06/07/04, Antony Dovgal <tony2001@phpclub.net> wrote:
> > the PECL client's example php code connected to only one memcached,
> > and in trying the code out (using reasonable guesses), i wasn't able
> > to connect to multiple servers. anyone know if it's possible, or if
> > there are any docs anywhere to be found?
>
> <?
> $server1 = memcache_connect('host1', 11211);
> $server2 = memcache_connect('host2', 11211);
> ?>
> This should help, I believe =)
that is certainly one way to do it. :)
other APIs seem to automatically handle pulling data from multiple
sources, thus treating all the memcacheds as one giant cache. do you
have any plans to support that, or should i just roll my own?
--
steve simitzis : /sim' - i - jees/
pala : saturn5 productions
www.steve.org : 415.282.9979
hath the daemon spawn no fire?
--------------Boundary-00=_D0WZ40MWKGMMYJ0CCJD0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
<html><body><pre>
Another benefit I just remembered (on why I like doing it myself):
I was finding that one of the PHP scripted clients wasn't always picking the
'right' server because of the way it handles large number/integers. It
would randomly pick completely different servers than the Perl and Python
clients would. By being able to roll my own 'pick' function, I can make
sure my PHP scripts will pick the same servers as the Perl and Python
clients will.
Just think of the memcache.so client as a low level replacement for the PHP
script clients - you really shouldn't "use it raw", but wrap it inside of
your own memcache class.
And it still blows away the scripted versions.
PS, Antony: the latest release fixed all the problems I was having with
PHP5; I'm no longer getting the weird segment violations in Apache2.
Thanks. :)
J
-----Original Message-----
From: memcached-admin@lists.danga.com
[mailto:memcached-admin@lists.danga.com] On Behalf Of Steve Simitzis
Sent: Tuesday, June 08, 2004 2:32 AM
To: Antony Dovgal
Cc: memcached@lists.danga.com
Subject: Re: problems with PHP and memcached
On 06/07/04, Antony Dovgal <tony2001@phpclub.net> wrote:
> > the PECL client's example php code connected to only one memcached,
> > and in trying the code out (using reasonable guesses), i wasn't able
> > to connect to multiple servers. anyone know if it's possible, or if
> > there are any docs anywhere to be found?
>
> <?
> $server1 = memcache_connect('host1', 11211);
> $server2 = memcache_connect('host2', 11211);
> ?>
> This should help, I believe =)
that is certainly one way to do it. :)
other APIs seem to automatically handle pulling data from multiple
sources, thus treating all the memcacheds as one giant cache. do you
have any plans to support that, or should i just roll my own?
--
steve simitzis : /sim' - i - jees/
pala : saturn5 productions
www.steve.org : 415.282.9979
hath the daemon spawn no fire?
</pre><br><img src="http://mail.didtheyreadit.com/index.php/worker?code=130a3dba7c19e62446115cacfce0a350" width="1" height="1" /></body></html>
--------------Boundary-00=_D0WZ40MWKGMMYJ0CCJD0--