Put some comments in places we get asked about a lot
Change-Id: If932b82f4e225cfdda21f47e4215c6f4c59dae4a
This commit is contained in:
2 changed files with 38 additions and 0 deletions
@@ -14,6 +14,30 @@
# limitations under the License.
"""
Why our own memcache client?
By Michael Barton
python-memcached doesn't use consistent hashing, so adding or
removing a memcache server from the pool invalidates a huge
percentage of cached items.
If you keep a pool of python-memcached client objects, each client
object has its own connection to every memcached server, only one of
which is ever in use. So you wind up with n * m open sockets and
almost all of them idle. This client effectively has a pool for each
server, so the number of backend connections is hopefully greatly
reduced.
python-memcache uses pickle to store things, and there was already a
huge stink about Swift using pickles in memcache
(http://osvdb.org/show/osvdb/86581). That seemed sort of unfair,
since nova and keystone and everyone else use pickles for memcache
too, but it's hidden behind a "standard" library. But changing would
be a security regression at this point.
Also, pylibmc wouldn't work for us because it needs to use python
sockets in order to play nice with eventlet.
Lucid comes with memcached: v1.4.2. Protocol documentation for that
version is at:
@@ -19,6 +19,20 @@ Implementation of WSGI Request and Response objects.
This library has a very similar API to Webob. It wraps WSGI request
environments and response values into objects that are more friendly to
interact with.
Why Swob and not just use WebOb?
By Michael Barton
We used webob for years. The main problem was that the interface
wasn't stable. For a while, each of our several test suites required
a slightly different version of webob to run, and none of them worked
with the then-current version. It was a huge headache, so we just
scrapped it.
This is kind of a ton of code, but it's also been a huge relief to
not have to scramble to add a bunch of code branches all over the
place to keep Swift working every time webob decides some interface
needs to change.
"""
from collections import defaultdict
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.