{ "info": { "author": "Giorgio Borelli", "author_email": "giorgio@giorgioborelli.it", "bugtrack_url": null, "classifiers": [ "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Internet", "Topic :: System :: Monitoring", "Topic :: Utilities" ], "description": "Introduction\n============\n\ncollective.warmup has been created to warm up web application's caches upon\nstart and restart.\n\nIt works by reading a configuration file containing a list of urls that\nare then invoked.\n\ncollective.warmup is inspired by Gil Forcada's `warmup_plone.py`_ script.\n\n\nWhy not a simple bash script?\n-----------------------------\n\nWhile the basic use case is very simple,\ncollective.warmup offers the following extra features:\n\n* Verifies the correctness of the response body (e.g. contains a certain string)\n* Can operate in *crawl mode*,\n following links in pages to warm up all related pages\n* Can filter out certain urls according to a general definition\n\n\nInstallation\n============\n\ncollective.warmup can be installed in two ways:\n\n* As a normal python package via pip\n* Inside a `buildout`_, with optional integration with `Plone`_\n\nDependencies\n------------\n\n* `lxml`_\n\n\nManual installation\n-------------------\n\nTo install it (using `virtualenv`_, on a GNU/Debian machine)::\n\n $ sudo apt-get install build-essential python-dev python-lxml python-virtualenv libxml2-dev libxslt1-dev\n $ virtualenv warmup && cd warmup && souce bin/activate\n (warmup) $ pip install collective.warmup\n\nand launch it with::\n\n (warmup) $ bin/warmup \n\n\nAlternative installation with buildout\n--------------------------------------\n\nTo integrate collective.warmup in a `buildout`_ with `Plone`_,\nadd this to your configuration::\n\n [buildout]\n ...\n parts =\n ...\n warmup\n\n\n [instance]\n ...\n eggs +=\n collective.warmup\n\n\n [instance]\n environment-vars +=\n WARMUP_BIN ${buildout:directory}/bin/warmup\n WARMUP_INI ${buildout:directory}/warmup.ini\n WARMUP_HEALTH_THRESHOLD 50000\n\n\n [warmup]\n recipe = zc.recipe.egg:scripts\n eggs = collective.warmup\n\n\nAfter executing the buildout you will find the warmup script\nin the ``bin`` directory.\n\nIn this example, the script will be executed automatically\nby the `Zope`_ instance each time it is started.\n\n\nConfiguration file\n------------------\n\nThis is a sample ``warmup.ini`` configuration::\n\n [warmup]\n enabled = True\n sleep = 2\n base_url = http://localhost\n logfile = /path/to/warmup.log\n\n urls =\n Home page\n\n\n [config]\n max_attempts = 2\n base_path = mysite\n\n\n [Home page]\n path = ${config:base_path}/\n max_attempts = ${config:max_attempts}\n check_exists =\n Welcome\n check_not_exists =\n p0wned by\n follow_links = True\n ignore_middle =\n @@\n ++theme++\n #\n ?\n ignore_end =\n .css\n .js\n .png\n .jpg\n .jpeg\n .gif\n .xml\n RSS\n .ico\n\n\nOptions\n-------\n\nGlobal [warmup]\n###############\n\nenable : ``True`` or ``False``\n If ``False``, the script will do nothing when invoked.\n\nsleep : integer\n The number of seconds the script waits between url retrievals.\n Defaults to ``2``.\n\nbase_url : a valid URL (**don't forget the protocol!**)\n The base URL to check\n (all paths in the various URL sections are relative to this URL).\n\nlog_file : a filesystem path\n The file where the logs will be written.\n\nurls : a list of sections (separated by newline)\n The URLs that we want to check.\n Each URL must have its own section in the configuration file (see below)\n and we reference these sections here (do not put real URLs here!).\n It also set an order for the checks (which are executed sequentially).\n\n\nURL section\n###########\n\nmax_attempts : integer\n The maximum number of attempts to check the url.\n Defaults to ``2``\n\npath : the path to check\n The path will be added to the ``base_url`` parameter in order to retrieve\n the page url\n\ncheck_exists : list of strings\n A list of strings that must be present in the page\n\ncheck_not_exists : list of strings\n A list of strings that must not be present in the page\n\nfollow_links : ``True`` or ``False``\n If ``True`` the script will follow the links in the page and will\n perform the same checks for each link.\n\nignore_middle : list of strings\n If ``follow_links`` is ``True``, the links containing one of these strings\n will be ignored\n\nignore_end : list of strings\n If ``follow_links`` is ``True``, the links ending with one of these strings\n will be ignored\n\n\nHealth check\n------------\nIn order not to mark backend healthy too early by the load-balancer, before proper\nwarmup, this package defines a browser view called ``@@health.check`` which can be\nused within your load-balancer probe mechanism. See bellow a Varnish configuration\nexample::\n\n backend instance_1 {\n .host = \"localhost\";\n .port = \"8081\";\n .probe = {\n .url = \"/health.check\";\n .interval = 5s;\n .timeout = 1s;\n .window = 5;\n .threshold = 3;\n }\n }\n\nThis way Varnish will mark the Zope instance backend healthy when\nZODB cache-size is bigger than ``WARMUP_HEALTH_THRESHOLD``. If you do not define\nthe ``WARMUP_HEALTH_THRESHOLD`` environment variable, the Zope instance backend\nwill be marked healthy as soon as Zope will be able to handle requests.\n\n\nCredits\n-------\n\n.. image:: http://www.abstract.it/logo-abstract-readme\n :alt: Abstract Website\n :target: http://abstract-technology.com/\n\n\n\n.. _virtualenv: http://www.virtualenv.org/en/latest/\n.. _Plone: http://plone.org\n.. _warmup_plone.py: https://gist.github.com/gforcada/7040082\n.. _buildout: http://www.buildout.org\n.. _Zope: http://zope.org\n.. _lxml: http://pypi.python.org/pypi/lxml\n\nChangelog\n=========\n\n1.2 (2016-09-08)\n----------------\n- Check for write permissions within logfile and fallback\n to a temporary file if can't write instead of sys.exit\n [avoinea]\n\n- Add @@health.check browser view to be used with load-balancer\n health-check in order not to mark backend healthy too early\n before proper warmup.\n [avoinea]\n\n- Avoid zombie processes. [jone]\n\n- Add zcml:condition for Plone 3 compatibility\n [gborelli]\n\n\n1.1 (2014-07-18)\n----------------\n\n- Python 2.4 support\n [gborelli]\n\n\n1.0 (2014-04-06)\n----------------\n\n- First release", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://svn.plone.org/svn/collective/", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.warmup", "package_url": "https://pypi.org/project/collective.warmup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.warmup/", "project_urls": { "Homepage": "http://svn.plone.org/svn/collective/" }, "release_url": "https://pypi.org/project/collective.warmup/1.2/", "requires_dist": null, "requires_python": "", "summary": "Collective Warmup", "version": "1.2" }, "last_serial": 2331994, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "1cf5223c06b1ea7d002ca385be6bdebb", "sha256": "d0250130efd4a5aed17820533e937109a457eb30d8dcfd30571f71257c529cdf" }, "downloads": -1, "filename": "collective.warmup-1.0.zip", "has_sig": false, "md5_digest": "1cf5223c06b1ea7d002ca385be6bdebb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28595, "upload_time": "2014-04-06T15:14:21", "url": "https://files.pythonhosted.org/packages/ee/f8/4ddf2a57f61206634bc53edcb3a2b07bf0165e4168c371e3ec5a52af6ab1/collective.warmup-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8695b893d24d894726d4578f6706e308", "sha256": "9857eef986ecb1dccccdcb8d3005faffa1d3ccb964a6542aa518afbdf3f2e658" }, "downloads": -1, "filename": "collective.warmup-1.1.zip", "has_sig": false, "md5_digest": "8695b893d24d894726d4578f6706e308", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28715, "upload_time": "2014-07-18T10:01:28", "url": "https://files.pythonhosted.org/packages/3a/93/212c4bbb889e4e3874a96deb956167f9ac63a1be1bb9a7625043e8b2bbeb/collective.warmup-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "74f10698bff26564d8a562f0d3514393", "sha256": "b635cd75d00c5c1d81ae834a570161be35f3754c86bb9f78864bfc9d3cdbfaa5" }, "downloads": -1, "filename": "collective.warmup-1.2.tar.gz", "has_sig": false, "md5_digest": "74f10698bff26564d8a562f0d3514393", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23484, "upload_time": "2016-09-08T18:03:31", "url": "https://files.pythonhosted.org/packages/86/7e/3b2fec3c51ff3c90a6f96546362fe71e016eb0e43216ce89244b1caeaa78/collective.warmup-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "74f10698bff26564d8a562f0d3514393", "sha256": "b635cd75d00c5c1d81ae834a570161be35f3754c86bb9f78864bfc9d3cdbfaa5" }, "downloads": -1, "filename": "collective.warmup-1.2.tar.gz", "has_sig": false, "md5_digest": "74f10698bff26564d8a562f0d3514393", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23484, "upload_time": "2016-09-08T18:03:31", "url": "https://files.pythonhosted.org/packages/86/7e/3b2fec3c51ff3c90a6f96546362fe71e016eb0e43216ce89244b1caeaa78/collective.warmup-1.2.tar.gz" } ] }