diff --git a/swift/common/memcached.py b/swift/common/memcached.py index 578bf6d5a0..03ab5e235a 100644 --- a/swift/common/memcached.py +++ b/swift/common/memcached.py @@ -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: diff --git a/swift/common/swob.py b/swift/common/swob.py index 1efc0f1839..af30bd9419 100644 --- a/swift/common/swob.py +++ b/swift/common/swob.py @@ -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

AltStyle によって変換されたページ (->オリジナル) /