{"id":545,"date":"2019-03-03T17:25:09","date_gmt":"2019-03-03T17:25:09","guid":{"rendered":"https:\/\/docs.control-webpanel.com\/docs\/admin-guide\/security\/cgroups-resources-limits"},"modified":"2020-10-23T12:31:34","modified_gmt":"2020-10-23T12:31:34","slug":"cgroups-resources-limits","status":"publish","type":"docs","link":"https:\/\/docs.control-webpanel.com\/docs\/admin-guide\/security\/cgroups-resources-limits","title":{"rendered":"cGroups Resources Limits"},"content":{"rendered":"<p>Cgroups allow you to limit resources per user \u2014 such as CPU %, system memory, network bandwidth, or combinations of these resources.<\/p>\n<p>Navigate to:<\/p>\n<pre>Security --&gt; Cgroups Resource Limits\r\n\r\n<\/pre>\n<p>Dedicated Servers Limits Available<\/p>\n<p>&#8211; CPU, Memory, Disk<\/p>\n<p>VPS: KVM LimitsAvailable<\/p>\n<p>&#8211; CPU, Memory, Disk<\/p>\n<p>VPS: OpenVZLimitsAvailable<\/p>\n<p>&#8211; Memory<\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Please note that some Cloud \/ VPS providers have a custom network that does not work with groups or limits that are not supported.<\/span><\/p>\n<p>Requirements<\/p>\n<p>&#8211; Default CentOS 7 kernel 3.10, possible to work with some others<\/p>\n<p>&#8211; CloudLinuxis NOT supported<\/p>\n<p>CPU Limit<\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">The 100% limit is a fully used CPU core, all user processes share this limit. <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">For example, two user processes will have a CPU power of 50% each. <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Limit range: 1 ~ (Number of cores) x 100, example for 4 cores: 1 ~ 400. <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Result: The user&#8217;s websites may be slower to respond if the user has higher demand scripts.<\/span><\/p>\n<p>RMEM (real RAM memory)<\/p>\n<p>RAM limit in MB, the value of 1024 MB will limit the shared RAM for the user to 1 GB.<\/p>\n<p>VMEM (Virtual Memory = RAM + swap)<\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Exchange limit in MB, the value of 2048 MB will limit the exchange for the user to 2 GB.<\/span><\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">It is recommended to have swap (VMEM) higher than RAM (RMEM).<\/span><\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Result: when the limitis reaches the system it kills the most memory demanding process.<\/span><\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">In case the script web server is down, it might return the server error 5xx in the active process.<\/span><\/p>\n<p>Disk Limit (read \/ write)<\/p>\n<p>Set the limit in KB per second, you can monitor this limit with iotop.<\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Result: The user&#8217;s websites may be slower to respond if the user has higher demand scripts.<\/span><\/p>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">Helpful Commands <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">cgdeletecpu: USERNAME (deletecpulimitfor USERNAME) <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">cgdeletememory: USERNAME (deletememorylimitfor USERNAME) <\/span><\/p>\n<p class=\"tw-data-text tw-text-large XcVN5d tw-ta\" dir=\"ltr\" data-placeholder=\"Traducci\u00f3n\"><span lang=\"en\">cgdeleteblkio: USERNAME (remove disk I \/ O limit for USERNAME)<\/span><\/p>\n<p><a  href=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1.jpg\" data-rel=\"lightbox-gallery-0\" data-rl_title=\"\" data-rl_caption=\"\" data-magnific_type=\"gallery\" title=\"\"><img loading=\"lazy\" class=\"aligncenter wp-image-2732 size-full\" src=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1.jpg\" alt=\"\" width=\"942\" height=\"1280\" srcset=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1.jpg 942w, https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1-221x300.jpg 221w, https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1-754x1024.jpg 754w, https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/2-1-768x1044.jpg 768w\" sizes=\"(max-width: 942px) 100vw, 942px\" \/><\/a>You can choose the domain settings of the limits and policies you want to add.<\/p>\n<p><strong>Add New Policy:\u00a0<\/strong><span lang=\"en\">Add Name, cpu% (min 1 max 200), Memory (min 1M max 32G), Disk KB \/ s (min 100) and click Save.<\/span><\/p>\n<p><a  href=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/4-7.png\" data-rel=\"lightbox-gallery-0\" data-rl_title=\"\" data-rl_caption=\"\" data-magnific_type=\"gallery\" title=\"\"><img loading=\"lazy\" class=\"aligncenter wp-image-2733 size-full\" src=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/4-7.png\" alt=\"\" width=\"410\" height=\"432\" srcset=\"https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/4-7.png 410w, https:\/\/docs.control-webpanel.com\/wp-content\/uploads\/2019\/03\/4-7-285x300.png 285w\" sizes=\"(max-width: 410px) 100vw, 410px\" \/><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":540,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"doc_tag":[],"_links":{"self":[{"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/545"}],"collection":[{"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/comments?post=545"}],"version-history":[{"count":4,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/545\/revisions"}],"predecessor-version":[{"id":2814,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/545\/revisions\/2814"}],"up":[{"embeddable":true,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/540"}],"next":[{"title":"CWP Secure Kernel","link":"https:\/\/docs.control-webpanel.com\/docs\/admin-guide\/security\/cwp-secure-kernel","href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/2712"}],"prev":[{"title":"Security Limits","link":"https:\/\/docs.control-webpanel.com\/docs\/admin-guide\/security\/security-limits","href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/docs\/544"}],"wp:attachment":[{"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/media?parent=545"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/docs.control-webpanel.com\/wp-json\/wp\/v2\/doc_tag?post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}