collective / pas.plugins.ldap

Zope (and Plone) PAS Plugin providing users and groups from LDAP directory
http://pypi.python.org/pypi/pas.plugins.ldap
Other
13 stars 20 forks source link

Thread safety for Memcached #58

Closed andbag closed 6 years ago

andbag commented 6 years ago

The Memcached class of bda.cache is not thread aware. This means that each time the cacheProviderFactory is called, a new connection is established to the memcached. For large LDAP directories, this leads to countless connections that waste system resources and increase the latency of the cache mechanism. This PR fixes the problem. Only one memcachd connection is established per zope thread and can be reused per request by the cacheProviderFactory.

rnixx commented 6 years ago

Thank you!