{"id":21745155,"url":"https://github.com/zuazo/swap_tuning-cookbook","last_synced_at":"2025-04-13T05:12:23.431Z","repository":{"id":18612245,"uuid":"21817619","full_name":"zuazo/swap_tuning-cookbook","owner":"zuazo","description":"Chef cookbook to create a swap file of the recommended size considering the system memory.","archived":false,"fork":false,"pushed_at":"2018-02-18T02:26:09.000Z","size":85,"stargazers_count":3,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T22:05:13.117Z","etag":null,"topics":["chef","cookbook","devops","optimization","swap","tuning"],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/swap_tuning","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuazo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-14T11:42:24.000Z","updated_at":"2020-04-06T14:58:45.000Z","dependencies_parsed_at":"2022-09-24T12:22:22.788Z","dependency_job_id":null,"html_url":"https://github.com/zuazo/swap_tuning-cookbook","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fswap_tuning-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fswap_tuning-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fswap_tuning-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fswap_tuning-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuazo","download_url":"https://codeload.github.com/zuazo/swap_tuning-cookbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665743,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","cookbook","devops","optimization","swap","tuning"],"created_at":"2024-11-26T07:13:47.091Z","updated_at":"2025-04-13T05:12:23.408Z","avatar_url":"https://github.com/zuazo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Swap Tuning Cookbook\n====================\n[![Cookbook Version](https://img.shields.io/cookbook/v/swap_tuning.svg?style=flat)](https://supermarket.chef.io/cookbooks/swap_tuning)\n[![Dependency Status](http://img.shields.io/gemnasium/zuazo/swap_tuning-cookbook.svg?style=flat)](https://gemnasium.com/zuazo/swap_tuning-cookbook)\n[![Code Climate](http://img.shields.io/codeclimate/github/zuazo/swap_tuning-cookbook.svg?style=flat)](https://codeclimate.com/github/zuazo/swap_tuning-cookbook)\n[![Build Status](http://img.shields.io/travis/zuazo/swap_tuning-cookbook.svg?style=flat)](https://travis-ci.org/zuazo/swap_tuning-cookbook)\n[![Coverage Status](http://img.shields.io/coveralls/zuazo/swap_tuning-cookbook.svg?style=flat)](https://coveralls.io/r/zuazo/swap_tuning-cookbook?branch=master)\n\n[Chef](https://www.chef.io/) cookbook to create a swap file of the recommended size considering the system memory.\n\nThis can be considered a general purpose cookbook but certainly not recommended for all cases.\n\nSwap size is chosen based on the following documentation:\n\n* [RedHat 7 Recommended Partitioning Scheme](https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html#sect-recommended-partitioning-scheme-x86)\n\n| RAM Size     | Recommended Swap     |\n|--------------|----------------------|\n| \u0026le; 2 GB    | 2 \u0026times; RAM        |\n| 2 GB - 8 GB  | = RAM                |\n| 8 GB - 64 GB | \u0026frac12; \u0026times; RAM |\n| \u0026gt; 64 GB   | workload dependent   |\n\n* [Ubuntu SwapFaq - How much swap do I need?](https://help.ubuntu.com/community/SwapFaq#How_much_swap_do_I_need.3F)\n\nIn case you already have swap in the system, creates another swap file with the difference if necessary.\n\nRequirements\n============\n\n## Supported Platforms\n\nThis cookbook has been tested on the following platforms:\n\n* Amazon\n* Arch Linux\n* CentOS\n* Debian\n* Fedora\n* OpenSUSE\n* RedHat\n* SUSE\n* Ubuntu\n\nPlease, [let us know](https://github.com/zuazo/swap_tuning-cookbook/issues/new?title=I%20have%20used%20it%20successfully%20on%20...) if you use it successfully on any other platform.\n\n## Required Cookbooks\n\n* [swap](https://supermarket.chef.io/cookbooks/swap)\n\n## Required Applications\n\n* Ruby `2` or higher.\n\nAttributes\n==========\n\n| Attribute                             | Default       | Description              |\n|---------------------------------------|:-------------:|--------------------------|\n| `node['swap_tuning']['size']`         | *calculated*  | Total swap size in MB.   |\n| `node['swap_tuning']['minimum_size']` | `nil`         | Swap minimum size in MB. |\n| `node['swap_tuning']['file_prefix']`  | `'/swapfile'` | Swap file name prefix.   |\n| `node['swap_tuning']['persist']`      | `true`        | Swap file persist.       |\n\nRecipes\n=======\n\n## swap_tuning::default\n\nCreates the swap file.\n\nUsage\n=====\n\n## Including in a Cookbook Recipe\n\nYou can simply include it in a recipe:\n\n```ruby\n# in your recipe\ninclude_recipe 'swap_tuning'\n```\n\nDon't forget to include the `swap_tuning` cookbook as a dependency in the metadata:\n\n```ruby\n# metadata.rb\ndepends 'swap_tuning'\n```\n\n## Including in the Run List\n\nAnother alternative is to include it in your Run List:\n\n```json\n{\n  \"name\": \"app001.example.com\",\n  \"[...]\": \"[...]\",\n  \"run_list\": [\n    \"[...]\",\n    \"recipe[swap_tuning]\"\n  ]\n}\n```\n\nTesting\n=======\n\nSee [TESTING.md](https://github.com/zuazo/swap_tuning-cookbook/blob/master/TESTING.md).\n\nContributing\n============\n\nPlease do not hesitate to [open an issue](https://github.com/zuazo/swap_tuning-cookbook/issues/new) with any questions or problems.\n\nSee [CONTRIBUTING.md](https://github.com/zuazo/swap_tuning-cookbook/blob/master/CONTRIBUTING.md).\n\nTODO\n====\n\nSee [TODO.md](https://github.com/zuazo/swap_tuning-cookbook/blob/master/TODO.md).\n\nLicense and Author\n==================\n\n|                      |                                          |\n|:---------------------|:-----------------------------------------|\n| **Author:**          | [Xabier de Zuazo](https://github.com/zuazo) (\u003cxabier@zuazo.org\u003e)\n| **Copyright:**       | Copyright (c) 2015, Xabier de Zuazo\n| **Copyright:**       | Copyright (c) 2014, Onddo Labs, SL.\n| **License:**         | Apache License, Version 2.0\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n        http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuazo%2Fswap_tuning-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuazo%2Fswap_tuning-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuazo%2Fswap_tuning-cookbook/lists"}