[Openstack] [Swift] Warning when running Swift on PyPy

Shrinand Javadekar shrinand at maginatics.com
Thu May 5 20:01:22 UTC 2016


Hi,

Based on the "Doubling Performance in Swift with No Code Changes" talk
at the Openstack Summit, I decided to give running Swift on PyPy a
shot. I configured a VM with Swift (largely based on the steps
mentioned in [1], although I did have to change a few things). Swift
was up and running. The /info endpoint showed the correct output.

However, when I tried to do a simple HEAD request to get all the
containers, I got the following warning. I did export PYPY_GC_MIN=15M
before starting the swift services.

May  5 00:35:59 shri-swift-tests swift-proxy-server: STDOUT:
/home/blah/pypy/lib-python/2.7/SocketServer.py:717:
RefCountingWarning: 'GreenSocket' object has no _reuse/_drop
methods#012{{#012    You make use (or a library you are using makes
use) of the internal#012    classes '_socketobject' and '_fileobject'
in socket.py, initializing#012    them with custom objects.  On PyPy,
these custom objects need two#012    extra methods, _reuse() and
_drop(), that maintain an explicit#012    reference counter.  When
_drop() has been called as many times as#012    _reuse(), then the
object should be freed.#012#012    Without these methods, you get the
warning here.  This is to#012    prevent the following situation: if
your (or the library's) code#012    relies on reference counting for
prompt closing, then on PyPy, the#012    __del__ method will be called
later than on CPython.  You can#012    easily end up in a situation
where you open and close a lot of#012    (high-level) '_socketobject'
or '_fileobject', but the (low-level)#012    custom objects will
accumulate before their __del__ are called.#012    You quickly risk
running out of file descriptors, for example.#012}}#012
self.rfile.close() (txn: txae85f55c9d3d4f26b96a5-00572a956f)

Any ideas how to get over this? What are the consequences of this?

Thanks in advance.
-Shri

[1] https://01.org/lp/documentation/pypy-enabling-guide-openstack-swift




More information about the Openstack mailing list