~bac/charmworld/tag-constraints

  • Committer: Tarmac
  • Author(s): Brad Crittenden
  • Date: 2014-03-19 12:59:41 UTC
  • mfrom: (494.1.2 mongo-client)
  • Revision ID: tarmac-20140319125941-iu0wiks8dcxehn92
Improve pymongo connection management.

Despite code in MongoTestBase to try to intelligently manage mongo
connections, sockets were being created and left open at a rate of about one
per test.  A default system has a limit of 1024 open connections.  As our test
suite exceeded that number failures were seen.

Adding a call to 'conn.disconnect' in tearDown did not help.

Research showed that we are using the deprecated call pymongo.Connection() to
create our connections.  The preferred connection class is now
pymongo.MongoClient.  

This branch converts all connection instantiation to use the new method.

By itself, this change was not very helpful.  But, when the call to
'disconnect' was added, the result was better.  Now the full suite uses about
250 open descriptors.

It is unclear why are all of these sockets are still open.  Some are shown to
be ESTABLISHED while many are in CLOSE_WAIT.

QA:

Run the tests in one window.

In another, find the pid of the test runner.
% ps auxww |grep nosetest

Then, keep an eye on the number of open file descriptors with
% watch 'lsof -p 39007 -Ff | tail -10'

Be careful as the results will be erased as soon as the tests finish.  You
should see something less than 300.

https://codereview.appspot.com/77700043/

R=bac, rharding.

Approved by Juju Gui Bot.
Filename Latest Rev Last Changed Committer Comment Size
..
charmworld 1 13 years ago kapil.foss at gmail charmworld pyramid starter Diff
docs 33 13 years ago kapil.foss at gmail add install doc Diff
scripts 21 13 years ago Kapil Thangavelu add ctl scripts Diff
.bzrignore 458.1.3 11 years ago j.c.sackett Bzr should ignore our conventional lp credentials 430 bytes Diff Download File
.lbox 419.1.2 11 years ago Brad Crittenden lbox defaults to -cr and sets project to charmworl 31 bytes Diff Download File
File .lbox.check 491.1.2 10 years ago Brad Crittenden Move lint before test in lbox.check 66 bytes Diff Download File
CHANGES.txt 67.1.10 11 years ago Kapil Thangavelu put back accidentally yanked changes 28 bytes Diff Download File
default.ini 474.1.6 10 years ago j.c.sackett Changes to address commentar in review. 2.9 KB Diff Download File
distribute_setup.py 71.1.2 12 years ago Rick Harding Add missing files 15.3 KB Diff Download File
LICENSE.txt 61 12 years ago kapil.foss at gmail add license 33.7 KB Diff Download File
Makefile 482.1.1 10 years ago Brad Crittenden Turn on lint for migrations and fix 5.1 KB Diff Download File
MANIFEST.in 1 13 years ago kapil.foss at gmail charmworld pyramid starter 133 bytes Diff Download File
README.txt 7 13 years ago kapil.foss at gmail work in progress on multi namespace support 252 bytes Diff Download File
requirements.txt 487.2.1 10 years ago Brad Crittenden Check charm constraints when doing proof. Lots of 1.3 KB Diff Download File
setup.cfg 304.4.26 11 years ago Aaron Bentley Move logging filters to nose config. 569 bytes Diff Download File
setup.py 461.3.2 11 years ago Benji York checkpoint 1.4 KB Diff Download File
test-setup.ini 474.1.6 10 years ago j.c.sackett Changes to address commentar in review. 668 bytes Diff Download File