Speed difference under load

Mikael Johansson mikael at synd.info
Wed Oct 31 16:50:10 UTC 2007


Hi,

There's also a retry_interval parameter (default 15 secs) you can give
to Memcache::addServer(), after this interval has expired a failed
connection will be retried.

//Mikael

K J wrote:
>     If you're using persistent connections, that server will still
>     be flagged as down on subsequent requests and will be skipped
>     immediately. 
> 
>  
> I see that you can set persistent connections with "pconnect".  However
> are there downsides to this?  Suppose a downed server comes back
> online.  Using a  persistent connection, would my app know about this?
>  
>  
>  
>  
> 
> 
>  
> On 10/27/07, *Mikael Johansson* <mikael at synd.info
> <mailto:mikael at synd.info>> wrote:
> 
>     Hi,
> 
>     The default connection timeout in pecl/memcache is 1 second, and when
>     using Memcache::addServer() the connection isn't established until the
>     first command is sent (ie. the "get" in your example). Perhaps you have
>     added several servers, one of which is unreachable, and thus the client
>     will stall 1 second before flagging that server as down and trying the
>     next one. If you're using persistent connections, that server will still
>     be flagged as down on subsequent requests and will be skipped
>     immediately.
> 
>     Or as Marc said, the client might indeed be waiting for a DNS
>     response..
> 
>     //Mikael
> 
>     K J wrote:
>     >     The slowdown is almost certainly in your client library. The
>     server, on
>     >     our systems, takes about 1.5 milliseconds to start up, and a
>     >     fraction of
>     >     a millisecond to answer the first request. But your client
>     might be
>     >     doing a lot of work the first time it executes. You didn't say
>     what your
>     >     client language and environment is, so it's kind of hard to
>     even take a
>     >     useful guess.
>     >
>     >
>     > The app is running on PHP and is using the PHP memcache library:
>     > http://cn2.php.net/manual/en/ref.memcache.php
>     >
>     > I record the time it takes to render a page, and every page ends up
>     > taking 1 second or so.  Most of that 1 second is due to the very first
>     > memcache get request.  It happens at every page that uses
>     memcache.  The
>     > only time this problem goes away is when I run a load testing tool
>     and
>     > start having multiple users hit the system constantly.
>     >
>     >
>     >
>     >
>     > On 10/27/07, *Steven Grimm* <sgrimm at facebook.com
>     <mailto:sgrimm at facebook.com>
>     > <mailto: sgrimm at facebook.com <mailto:sgrimm at facebook.com>>> wrote:
>     >
>     >     K J wrote:
>     >     > So it's normal to have Memcache's response time be 1 second,
>     if the
>     >     > system is relatively idle?  This happens when I'm basically
>     the only
>     >     > user on the system, logging in, checking pages, etc.
>     >
>     >     The slowdown is almost certainly in your client library. The
>     server, on
>     >     our systems, takes about 1.5 milliseconds to start up, and a
>     fraction of
>     >     a millisecond to answer the first request. But your client
>     might be
>     >     doing a lot of work the first time it executes. You didn't say
>     what your
>     >     client language and environment is, so it's kind of hard to
>     even take a
>     >     useful guess.
>     >
>     >     -Steve
>     >
>     >
> 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.danga.com/pipermail/memcached/attachments/20071031/0336b239/signature-0001.pgp


More information about the memcached mailing list