{ "info": { "author": "Greg McGuire", "author_email": "gregjmcguire+github@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Topic :: Database" ], "description": "Django DB Pool\n=============\n\n**Note that this code has not been rigorously tested in high-volume production systems! You should perform your own\nload / concurrency tests prior to any deployment. And of course, patches are highly appreciated.**\n\nAnother connection pool \"solution\"?\n-----------------------------------\n\nYes, alas. Django punts on the problem of pooled / persistant connections ([1][1]), generally telling folks to use a \ndedicated application like PGBouncer (for Postgres.) However that's not always workable on app-centric platforms like \nHeroku, where each application runs in isolation. Thus this package. There are others ([2][2]), but this one attempts \nto provide connection persistance / pooling with as few dependencies as possible.\n\nCurrently only the Django's postgres_psycopg2 / postgis drivers are supported. Connection pooling is implemented by \nthinly wrapping a psycopg2 connection object with a pool-aware class. The actual pool implementation is psycop2g's \nbuilt-in [ThreadedConnectionPool](http://initd.org/psycopg/docs/pool.html), which handles thread safety for the pool \ninstance, as well as simple dead connection testing when connections are returned. \n\nBecause this implementation sits inside the python interpreter, in a multi-process app server environment the pool will \nnever be larger than one connection. However, you can still benefit from connection persistance (no connection creation \noverhead, query plan caching, etc.) so the (minimal) additional overhead of the pool should be outweighed by these \nbenefits. TODO: back this up with some data!\n\n\nRequirements\n------------\n\n* [Django 1.3 - 1.5](https://www.djangoproject.com/download/)\n* [PostgreSQL](http://www.postgresql.org/) or [PostGIS](http://postgis.net/) for your database\n\n\nInstallation\n------------\n\n pip install django-db-pool\n\n\nUsage\n-----\n\n* PostgreSQL\n * Change your `DATABASES` -> `ENGINE` from `'django.db.backends.postgresql_psycopg2'` to `'dbpool.db.backends.postgresql_psycopg2'`.\n* PostGIS\n * Change your `DATABASES` -> `ENGINE` from `'django.contrib.gis.db.backends.postgis'` to `'dbpool.db.backends.postgis'`.\n\nIf you are in a multithreaded environment, also set `MAX_CONNS` and optionally `MIN_CONNS` in the `OPTIONS`, \nlike this:\n\n 'default': {\n 'ENGINE': 'dbpool.db.backends.postgresql_psycopg2', \n 'OPTIONS': {'MAX_CONNS': 1},\n # These options will be used to generate the connection pool instance\n # on first use and should remain unchanged from your previous entries\n 'NAME': 'test',\n 'USER': 'test',\n 'PASSWORD': 'test123',\n 'HOST': 'localhost',\n 'PORT': '',\n }\n\nSee the [code][base] for more information on settings `MAX_CONNS` and `MIN_CONNS`.\n\nYou can set `TEST_ON_BORROW` (also in the `OPTIONS`) to True if you would like a connection to be validated each time it is\nchecked out. If you enable this, any connection that fails a test query will be discarded from the pool and a new connection \nfetched, retrying up to the largest size of the pool. Since this incurs some overhead you should weigh it against the \nbenefit of transparently recovering from database connection failures.\n\nLastly, if you use [South](http://south.aeracode.org/) (and you should!) you'll want to make sure it knows that you're still \nusing Postgres:\n\n SOUTH_DATABASE_ADAPTERS = {\n 'default': 'south.db.postgresql_psycopg2',\n }\n\n[1]: https://groups.google.com/d/topic/django-users/m1jeE4Cxr9A/discussion\n[2]: https://github.com/jinzo/django-dbpool-backend\n[base]: https://github.com/gmcguire/django-db-pool/blob/0.0.8/dbpool/db/backends/postgresql_psycopg2/base.py#L47-60", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gmcguire/django-db-pool", "keywords": null, "license": "BSD licence, see LICENSE", "maintainer": null, "maintainer_email": null, "name": "django-db-pool", "package_url": "https://pypi.org/project/django-db-pool/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-db-pool/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/gmcguire/django-db-pool" }, "release_url": "https://pypi.org/project/django-db-pool/0.0.10/", "requires_dist": null, "requires_python": null, "summary": "Basic database persistance / connection pooling for Django + Postgres.", "version": "0.0.10" }, "last_serial": 855685, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b5e7739ac5930a9c16396f59aaf9038c", "sha256": "6ad12b3767bc367ac69b460e7c0baae1690fdc6f16c098653c0d1931dab6d10d" }, "downloads": -1, "filename": "django-db-pool-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b5e7739ac5930a9c16396f59aaf9038c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5273, "upload_time": "2012-06-12T20:32:24", "url": "https://files.pythonhosted.org/packages/40/cd/2efc1b2f34a56085f744632933df89d01cfa1b184ec33bdeb24d252de826/django-db-pool-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "26b6a7805b26edd123c74bbe62ffd468", "sha256": "1b10b837810074f0aacac0015fd55c7b02c94e1b5e171bb890a8175c7586a4f1" }, "downloads": -1, "filename": "django-db-pool-0.0.10.tar.gz", "has_sig": false, "md5_digest": "26b6a7805b26edd123c74bbe62ffd468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8407, "upload_time": "2013-09-03T13:25:27", "url": "https://files.pythonhosted.org/packages/83/13/dbea5ec510cb2d2769a96b538e6cd05539900732acec9361a7c230f84649/django-db-pool-0.0.10.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "707f54597a59996c5ac5df1257d5eca8", "sha256": "1abf1a6f428dfea5c8be7f644a1bf89a719ce51df81398044934b7012450e28b" }, "downloads": -1, "filename": "django-db-pool-0.0.2.tar.gz", "has_sig": false, "md5_digest": "707f54597a59996c5ac5df1257d5eca8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5653, "upload_time": "2012-06-12T21:42:36", "url": "https://files.pythonhosted.org/packages/8b/cc/48fb9d88186f86afb5800bcda15c122cb2161db9ac3d25bab95a6dafce45/django-db-pool-0.0.2.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a7e29a0a8da5a83b1e6dd27c28eca35c", "sha256": "ff3b32e4758d6f304794b665ea152adcb98be8aa48d504c96ecce5a2f9d62717" }, "downloads": -1, "filename": "django-db-pool-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a7e29a0a8da5a83b1e6dd27c28eca35c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5873, "upload_time": "2012-06-13T17:56:13", "url": "https://files.pythonhosted.org/packages/97/80/0e7230f3b72f2d512abbe85b648020c9a9e1ccdb717add03c42feceb7ebc/django-db-pool-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "28c289fee50c036a3227e15ce3f90180", "sha256": "5b31a27797299afd3b170eb4aed7fa4a6c27363f71ef941e8fbefe72f4014174" }, "downloads": -1, "filename": "django-db-pool-0.0.6.tar.gz", "has_sig": false, "md5_digest": "28c289fee50c036a3227e15ce3f90180", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6408, "upload_time": "2012-09-28T18:49:45", "url": "https://files.pythonhosted.org/packages/0c/4c/94db2697d5b0d53fee20df6cd294e70aa8be1987d0eae560c35aabdd3a23/django-db-pool-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "fd5730aac015012157f09ecae9baeaf6", "sha256": "ff3d5790b4db97cef6007834363f422f338e8cdbfaeae56ca674c43f8e29adef" }, "downloads": -1, "filename": "django-db-pool-0.0.7.tar.gz", "has_sig": false, "md5_digest": "fd5730aac015012157f09ecae9baeaf6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6450, "upload_time": "2012-10-16T15:00:05", "url": "https://files.pythonhosted.org/packages/fc/1f/cb2bb75a9eadb9a6a942f43c2d8e1524c2197ad021043795f8a804a208e8/django-db-pool-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "8d0b13bebb2cbafee588cc19718021bc", "sha256": "c3701000895393463238179c619bb0ba96e220c00e55d79b3575d50b2eb0a0f5" }, "downloads": -1, "filename": "django-db-pool-0.0.8.tar.gz", "has_sig": false, "md5_digest": "8d0b13bebb2cbafee588cc19718021bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6516, "upload_time": "2013-02-01T14:17:22", "url": "https://files.pythonhosted.org/packages/23/99/1623bf55469419f09d466fa34dc22d1dbc95b88db890fbc3b23c679b4cb4/django-db-pool-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "87c857ea11bc466925e44181321a36c6", "sha256": "7159e2c2b1af0b8d3f4103b2172573d8fc0a752079e7f5b2b7134c300718388b" }, "downloads": -1, "filename": "django-db-pool-0.0.9.tar.gz", "has_sig": false, "md5_digest": "87c857ea11bc466925e44181321a36c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7416, "upload_time": "2013-03-08T14:34:59", "url": "https://files.pythonhosted.org/packages/1f/35/f9b4e010fb03c06e498fb327cfe39744c12e5c02e5ab71244ecdd912880d/django-db-pool-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26b6a7805b26edd123c74bbe62ffd468", "sha256": "1b10b837810074f0aacac0015fd55c7b02c94e1b5e171bb890a8175c7586a4f1" }, "downloads": -1, "filename": "django-db-pool-0.0.10.tar.gz", "has_sig": false, "md5_digest": "26b6a7805b26edd123c74bbe62ffd468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8407, "upload_time": "2013-09-03T13:25:27", "url": "https://files.pythonhosted.org/packages/83/13/dbea5ec510cb2d2769a96b538e6cd05539900732acec9361a7c230f84649/django-db-pool-0.0.10.tar.gz" } ] }