{ "info": { "author": "Stefan Foulis", "author_email": "stefan@foulis.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "django-graceful-session-cleanup\n===============================\n\nA simple management command that can delete expired sessions from large session tables without killing the site.\n\nThe main use case is if you have a live application with millions of stale sessions in the database. Runnung the\nregular ``python manage.py cleanup`` will potentially lock your database for hours, essentially killing your site.\n\nWith ``django-graceful-session-cleanup`` you can gradually delete all the sessions.\n\nTo achieve this it will always only delete a small amount of the expired sessions per query and then sleep for\na few seconds. There are commandline options to control interval, sleep time and amount of sessions to delete\nper interval.\n\n\nInstallation\n------------\n\ninstall the package::\n\n pip install django-graceful-session-cleanup\n\nadd it to ``INSTALLED_APPS``::\n\n INSTALLED_APPS = [\n \t....\n \t'graceful_session_cleanup',\n ]\n\nrun the management command::\n\n python manage.py graceful_session_cleanup\n\n\nThere are a few options you can use::\n\n python manage.py graceful_session_cleanup --sleep-seconds 9 --delete-count 1000 --iteration-count 200\n\nThis will delete ``1000`` expired session entries, wait for ``5`` seconds so other processes can use the\ndatabase and then repeat this ``200`` times. Depending on database load (assuming deleting takes ``1s``) this\nwill take ``(9s + 1s) * 200 = 2000s``.\n\n\nthere is help on the commandline::\n\n $ python manage.py help graceful_session_cleanup\n Usage: django graceful_session_cleanup [options]\n\n Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment). Does this in a live db friendly way by never hogging the connection too long.\n\n Options:\n -v VERBOSITY, --verbosity=VERBOSITY\n Verbosity level; 0=minimal output, 1=normal output,\n 2=all output\n --settings=SETTINGS The Python path to a settings module, e.g.\n \"myproject.settings.main\". If this isn't provided, the\n DJANGO_SETTINGS_MODULE environment variable will be\n used.\n --pythonpath=PYTHONPATH\n A directory to add to the Python path, e.g.\n \"/home/djangoprojects/myproject\".\n --traceback Print traceback on exception\n -s SLEEP_SECONDS, --sleep-seconds=SLEEP_SECONDS\n How long to sleep between each delete operation.\n -c DELETE_COUNT, --delete-count=DELETE_COUNT\n How many expired sessions to delete per iteration.\n -i ITERATION_COUNT, --iteration-count=ITERATION_COUNT\n How many iterations to run.\n --version show program's version number and exit\n -h, --help show this help message and exit", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/stefanfoulis/django-graceful-session-cleanup", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-graceful-session-cleanup", "package_url": "https://pypi.org/project/django-graceful-session-cleanup/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-graceful-session-cleanup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/stefanfoulis/django-graceful-session-cleanup" }, "release_url": "https://pypi.org/project/django-graceful-session-cleanup/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "A simple management command that can delete expired sessions from large session tables without killing the site.", "version": "0.2.2" }, "last_serial": 3552889, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a06af84eafcfb942b6b5f9000930b8ee", "sha256": "a4a4596a167dbfc28c31a1b6232b82d46e2e8448b31d23ddcf427c27d9ca129b" }, "downloads": -1, "filename": "django-graceful-session-cleanup-0.1.tar.gz", "has_sig": false, "md5_digest": "a06af84eafcfb942b6b5f9000930b8ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3208, "upload_time": "2012-07-10T15:33:02", "url": "https://files.pythonhosted.org/packages/89/93/1f86864c3a946beb39c517cfc1622b97376ed51fac9de47d3a2bf97a5dca/django-graceful-session-cleanup-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "8c7c00315907bd9f32b709635f17c592", "sha256": "f892ad2136e5f9f560fb57593e64782ed765daae8527f6193ce94ab40be49343" }, "downloads": -1, "filename": "django-graceful-session-cleanup-0.2.tar.gz", "has_sig": false, "md5_digest": "8c7c00315907bd9f32b709635f17c592", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3308, "upload_time": "2012-07-10T16:08:01", "url": "https://files.pythonhosted.org/packages/bf/2e/9864c4bdc18297cd63f874ec7ed6f356ff81747dd2c37ed7eaef6b50fb88/django-graceful-session-cleanup-0.2.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "95f452f75801a4a77a9c59c418dce042", "sha256": "c52c665e6804e1bd751951c89457c5c8c96b982ab85395af0d32265d405ccecc" }, "downloads": -1, "filename": "django-graceful-session-cleanup-0.2.2.tar.gz", "has_sig": false, "md5_digest": "95f452f75801a4a77a9c59c418dce042", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3586, "upload_time": "2012-07-10T16:53:04", "url": "https://files.pythonhosted.org/packages/71/64/70258e03e35d675f3856faf6f4d4bf5cb288eef3b7a09fae0886b061eb22/django-graceful-session-cleanup-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95f452f75801a4a77a9c59c418dce042", "sha256": "c52c665e6804e1bd751951c89457c5c8c96b982ab85395af0d32265d405ccecc" }, "downloads": -1, "filename": "django-graceful-session-cleanup-0.2.2.tar.gz", "has_sig": false, "md5_digest": "95f452f75801a4a77a9c59c418dce042", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3586, "upload_time": "2012-07-10T16:53:04", "url": "https://files.pythonhosted.org/packages/71/64/70258e03e35d675f3856faf6f4d4bf5cb288eef3b7a09fae0886b061eb22/django-graceful-session-cleanup-0.2.2.tar.gz" } ] }