Comments (20)
Do you see any issues with the way its set up to work right now? In the ServiceBuilder class, im setting the first arg of Memcached
to a serialized string of the hosts
from cache-bundle.
I saw that and for me there is no clear mistake on your code, I would have done a pull request otherwise. More research brought me to some people saying that some issues exist with php itself (see comments : http://www.php.net/manual/en/memcached.construct.php).
from cache-bundle.
Ahh, well that pinpoints it for me. Its adding the servers every time, even if they are already in the list. Not sure how to do a getServerList with the definitions...
from cache-bundle.
Does this take care of it? If it does, I'll tag it
from cache-bundle.
No, doesn't change anything... after 4 refresh I got 200 openned connections with persistent param and maximum 10 without...
from cache-bundle.
@faboo03 i cant really seem to find anything that fixes this issue...
from cache-bundle.
hmm weird issue, can someone explain to me please how to replicate it? step by step
from cache-bundle.
My config is : Ubuntu Desktop 13.04, PHP 5.3.3 with memcached and php-memcached.
I am using the last SF 2.3.
My file config.yml :
aequasi_cache:
instances:
default:
persistent: true #turning it false, solve the problem
namespace: %app.cache_prefix%
type: memcached
hosts:
- { host: %memcache_host%, port: %memcache_port%, weight: 100 }
doctrine:
enabled: true
result:
instance: default
entity_managers: [ default ]
query:
instance: default
entity_managers: [ default ]
Now when I get some pages I check for current_connection using : telnet localhost:11211
and the command stats
and I see a crazy number increasing to the crash of my local server.
If you need more informations, don't hesitate !
from cache-bundle.
have you tried to upgrade your php?
from cache-bundle.
I have the same problem on my local, inte, preprod and prod env.
They have different configurations and I don't have access on the preprod and prod env. I don't think it's a problem with PHP. I have an access on a php5.4 env, I am trying right now and keep you updated.
from cache-bundle.
same problem with php5.4...
from cache-bundle.
We experienced this issue after upgrading to a version 253eede and later.
After a rollback to 2.1.5 the servers went back to normal.
We are not using persistent connections since that also leads to the connection increase issue without connections getting closed.
from cache-bundle.
@ccMatrix rolling back to before that commit should actually give you the issue of your server list being filled with duplicate servers... I'm not really seeing anything in that commit that would cause the connection issue..
from cache-bundle.
I just checked the two tagged versions. I will go through it commit by commit to pinpoint the exact source of the problem.
from cache-bundle.
I found it. In 7186301 you updated the way you instantiate the classes. There you just check for isset on the persistent key. So persistent = false is handled just like persistent = true. This lead to our connection issues.
from cache-bundle.
K, fixed that in d92144a
from cache-bundle.
I have the same problem.
d92144a doesn't seem to fix the issue for unclosed connections when using persistent connections.
Don't ask me why, but it seems that setting Memcached::OPT_TCP_NODELAY to true fixes the problem.
from cache-bundle.
@ccMatrix @faboo03, does setting Memcached::OPT_TCP_NODELAY
to true do anything for you guys?
from cache-bundle.
Sorry, I got confused. Actually, the problem was not solved by the Memcached::OPT_TCP_NODELAY
setting.
The problem is that since v2.1, Memcached::getServerList()
does not return the weight of the server anymore as it's not allowed by the Api (refer https://github.com/php-memcached-dev/php-memcached/blob/master/php_memcached.c#L2943). Php documentation is outdated.
Hence, we are still experiencing the problem of servers being added on every script call, although we only notice it when using persistent connections.
Simply removing the weight
key in Aequasi\Bundle\CacheBundle\Cache\Memcached::addServer()
when iterating over existing servers solves the problem.
In addition, IMO the persistent connection id should be set through a config var rather than a serialized hosts array for the following reasons:
1/ persistent_id should be short as it infringes on maximum key length.
2/ you could want to use same servers and different connection ids wether in dev or prod env and you don't necessarily want your id to change whenever you add or remove a server or change server weight
I think the persistent
config var could accept boolean and string values in order not to break BC.
I'd be glad to help if you want.
from cache-bundle.
@cdaguerre go for it :) I don't remember where I saw it, but the suggestion was to use a serialized array of the hosts. I definitely agree with your points though 👍
from cache-bundle.
Related Issues (20)
- Use other type of cache HOT 1
- Issue with using Symfony 2.0.1 version HOT 2
- file cache
- Multiple Memcached Instances HOT 6
- Metadata and Memcached HOT 1
- Wrong configuration setting for type HOT 5
- Memcached options HOT 1
- Session TTL is not used as shown in example configuration
- Travis builds against multiple symfony versions HOT 4
- Replace dependency "symfony/symfony" with "symfony/framework-bundle" HOT 1
- Add dev dependency "phpunit/phpunit" HOT 1
- Routing Caching with FOS Rest Bundle HOT 2
- disable memcache for one or two specific queries HOT 1
- Clearing memcache from sf2 console command HOT 1
- Missing the underlying interface of Symfony UrlMatcher HOT 2
- symfoy3 support HOT 3
- aequasi/cache-bundle dev-master requires psr/cache-implementation ~1.0 -> no matching package found. HOT 2
- PHP requirement ~5.3 HOT 1
- Problem with composer HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache-bundle.