php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58114 First get slow when using multiple memcached servers
Submitted: 2008-03-24 17:08 UTC Modified: 2011-07-12 01:53 UTC
From: mail at robertlacroix dot com Assigned: hradtke (profile)
Status: Closed Package: memcache (PECL)
PHP Version: 5.2.0 OS: Debian Etch AMD64
Private report: No CVE-ID: None
 [2008-03-24 17:08 UTC] mail at robertlacroix dot com
Description:
------------
We are monitoring memcached performance and noticed that when we added a second memcached via Memcache::addServer the first get request is always slower than the subsequent ones although we are using persitent memcached connections. Switching from crc32 to fnv hashing didn't help either. Is that delay explainable?

Performance of 10 gets to the same key with two servers:

Query took 1.646 ms
Query took 0.222 ms
Query took 0.205 ms
Query took 0.204 ms
Query took 0.228 ms
Query took 0.190 ms
Query took 0.237 ms
Query took 0.190 ms
Query took 0.200 ms
Query took 0.200 ms
Query took 0.201 ms

Performance of 10 gets to the same key with one server:

Query took 0.279 ms
Query took 0.230 ms
Query took 0.253 ms
Query took 0.220 ms
Query took 0.224 ms
Query took 0.221 ms
Query took 0.224 ms
Query took 0.194 ms
Query took 0.219 ms
Query took 0.219 ms
Query took 0.220 ms


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-21 09:07 UTC] kelfe at gmx dot de
I also noticed slowdowns in 3.0.1 but a lot bigger ones when trying to update from 2.2.3 to 3.0.1

after switching to debug mode in our app the time it takes after adding 2 remote machines to get an extended stats is about 80ms
and a big fetch takes more than 2000ms for around 580kb

reverting to 2.2.3 resolves the delay/slowdown

the correct times are nearly none for the first and about 5ms for the big fetch

php is running as fcgi under lighttpd
 [2008-04-21 12:14 UTC] mail at robertlacroix dot com
We are experiencing the described behaviour in 2.2.3.
 [2008-09-15 12:58 UTC] ktamas77 at gmail dot com
We're experiencing pretty similar problems only with 
multiple servers. With one server, each get/set is fast, but 
when we're adding more than one memcached servers, then get 
will be significally slower but not only for the first time 
but totally randomly; about 5% of the reads are 5x slower 
than only with one server. Please advice.

We've tried pecl client 2.2.3 & 2.2.4 - same problem.
 [2008-12-07 13:38 UTC] ob dot pecl at daevel dot fr
We confirm the problem. From our monitoring, it seems that persistent connections don't work when multiple servers are used.
 [2010-03-24 10:29 UTC] hradtke@php.net
Please post the script you used to get those results.  I always see the initial slowness when using Memcache::addServer once or twice.
 [2010-03-24 15:05 UTC] mail at robertlacroix dot com
I did again some testing and also upgraded from 2.2.3 to 
2.2.5. All of a sudden the delay of 1.5-2.0 ms on first get 
went away. I think we can close the bug. Can maybe ktamas77 or 
ob confirm that it is fixed with 2.2.5 for them as well?
 [2010-04-25 13:25 UTC] hradtke@php.net
Please provide feedback so we can continue looking at this issue.
 [2011-03-10 21:44 UTC] hradtke@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2012-12-06 23:09 UTC] ktamas77 at gmail dot com
Thank you for your help. Yes, the problem doens't exists anymore. Sorry for the 
slow reply.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 07:01:29 2024 UTC