GithubHelp home page GithubHelp logo

Comments (20)

cryptiklemur avatar cryptiklemur commented on June 15, 2024

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.

faboo03 avatar faboo03 commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

253eede

Does this take care of it? If it does, I'll tag it

from cache-bundle.

faboo03 avatar faboo03 commented on June 15, 2024

No, doesn't change anything... after 4 refresh I got 200 openned connections with persistent param and maximum 10 without...

from cache-bundle.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

@faboo03 i cant really seem to find anything that fixes this issue...

from cache-bundle.

cordoval avatar cordoval commented on June 15, 2024

hmm weird issue, can someone explain to me please how to replicate it? step by step

from cache-bundle.

faboo03 avatar faboo03 commented on June 15, 2024

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.

cordoval avatar cordoval commented on June 15, 2024

have you tried to upgrade your php?

from cache-bundle.

faboo03 avatar faboo03 commented on June 15, 2024

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.

faboo03 avatar faboo03 commented on June 15, 2024

same problem with php5.4...

from cache-bundle.

ccMatrix avatar ccMatrix commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

@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.

ccMatrix avatar ccMatrix commented on June 15, 2024

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.

ccMatrix avatar ccMatrix commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

K, fixed that in d92144a

from cache-bundle.

cdaguerre avatar cdaguerre commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

@ccMatrix @faboo03, does setting Memcached::OPT_TCP_NODELAY to true do anything for you guys?

from cache-bundle.

cdaguerre avatar cdaguerre commented on June 15, 2024

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.

cryptiklemur avatar cryptiklemur commented on June 15, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.