{"id":22794696,"url":"https://github.com/mconf/docker-resource-limit-check","last_synced_at":"2025-03-30T17:43:47.716Z","repository":{"id":136205756,"uuid":"110719566","full_name":"mconf/docker-resource-limit-check","owner":"mconf","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-16T17:50:12.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-05T20:01:15.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mconf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-14T17:01:31.000Z","updated_at":"2019-04-04T20:22:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0cbe9f5-e8cd-42ac-8c89-11b3b376fbf0","html_url":"https://github.com/mconf/docker-resource-limit-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mconf%2Fdocker-resource-limit-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mconf%2Fdocker-resource-limit-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mconf%2Fdocker-resource-limit-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mconf%2Fdocker-resource-limit-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mconf","download_url":"https://codeload.github.com/mconf/docker-resource-limit-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246357753,"owners_count":20764361,"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":[],"created_at":"2024-12-12T04:09:52.609Z","updated_at":"2025-03-30T17:43:47.711Z","avatar_url":"https://github.com/mconf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-resource-limit-check\n\nThis is for testing wether the resource limitations for a container will work on a given host. Generate the container and run it with the flags and script according to what you wish to test.\n\nFor testing memory limits, use:\n\n```\ndocker run --memory-swappiness=0 -m \u003cn\u003eg --memory-swap \u003cn\u003eg \u003cimage_name\u003e ./eat_memory.py\n```\n\nThese flags will limit the container's memory at `\u003cn\u003e` gigabytes and will prevent the container from using swap. `--memory-swap` depend on some kernel functionalities that might not be available or enabled, so instead of limiting the swap with `--memory-swap` we use `--memory-swappiness=0` and prevent swap altogether.\n\nThe script we use for consuming memory inside the container was adapted from [this stackoverflow post](https://stackoverflow.com/questions/6317818/how-to-eat-memory-using-python).\n\nFor testing cpu limits, use:\n\n```\ndocker run --cpu=\"\u003cm\u003e\" \u003cimage_name\u003e ./consume_cpu.py\n```\n\nThis will limit at `\u003cm\u003e` the number of cpus available to the container.\n\nSee more:\n[Limiting container resources](https://docs.docker.com/engine/admin/resource_constraints/)\n[Enable kernel capabilities](https://docs.docker.com/engine/installation/linux/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities)\n[Checking container metrics](https://blog.docker.com/2013/10/gathering-lxc-docker-containers-metrics/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmconf%2Fdocker-resource-limit-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmconf%2Fdocker-resource-limit-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmconf%2Fdocker-resource-limit-check/lists"}