{"id":17536,"date":"2026-04-16T10:04:13","date_gmt":"2026-04-16T04:34:13","guid":{"rendered":"https:\/\/www.skynats.com\/blog\/?p=17536"},"modified":"2026-04-16T10:04:16","modified_gmt":"2026-04-16T04:34:16","slug":"how-to-manage-resources-with-systemd-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/","title":{"rendered":"How to Manage Resources with systemd on Ubuntu?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-introduction\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>Managing system resources like CPU and memory is very important for maintaining a stable and efficient server. In Ubuntu, <strong>systemd resource management<\/strong> helps control how processes use these resources through a feature called cgroups (control groups). Two important components of this system are slices and scopes. These help organize processes and apply resource limits effectively.<\/p>\n\n\n\n<p>In this blog, you will learn what slices and scopes are, and how to use them in a simple way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p>Before getting started, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An Ubuntu OS<\/li>\n\n\n\n<li>Basic knowledge of Linux commands<\/li>\n\n\n\n<li>Sudo (administrator) access<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Understanding Slices and Scopes<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Slices<\/strong>: They are used to group services together and apply shared resource limits like CPU and memory.<\/li>\n\n\n\n<li><strong>Scopes<\/strong>: They are used to manage processes that are not started directly by systemd, such as manually executed commands.<\/li>\n<\/ul>\n\n\n\n<p>In simple terms:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Slices = Organizing and limiting services<\/li>\n\n\n\n<li>Scopes = Managing running processes<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Steps to Use systemd Slices and Scopes<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 1: View Current System Hierarchy<\/strong><\/h3>\n\n\n\n<p>You can see how processes are organized using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemd-cgls\nsystemd-cgtop<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 2: Create a Custom Slice<\/strong><\/h3>\n\n\n\n<p>Create a new slice to group services:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/systemd\/system\/myfirst.slice<\/code><\/pre>\n\n\n\n<p>Add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Slice]\nMemoryMax=2G\nCPUQuota=200%\nTasksMax=500<\/code><\/pre>\n\n\n\n<p>Reload systemd:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl start myfirst.slice<\/code><\/pre>\n\n\n\n<p>This sets limits for all services in the slice.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 3: Assign Services to the Slice<\/strong><\/h3>\n\n\n\n<p>Edit your service file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Service]\nSlice=myfirst.slice<\/code><\/pre>\n\n\n\n<p>Now multiple services will share the same resource limits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 4: Create Nested Slices (Optional)<\/strong><\/h3>\n\n\n\n<p>You can create parent and child slices to organize workloads. For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>app.slice<\/li>\n\n\n\n<li>app-web.slice<\/li>\n\n\n\n<li>app-workers.slice<\/li>\n<\/ul>\n\n\n\n<p>Child slices inherit limits from parent slices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 5: Use Scopes for Running Processes<\/strong><\/h3>\n\n\n\n<p>Run a process inside a controlled scope:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemd-run --scope -p MemoryMax=512M -p CPUQuota=50% \/path\/to\/app<\/code><\/pre>\n\n\n\n<p>This allows you to control resources for temporary processes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-step-6-monitor-resource-usage\"><strong>Step 6: Monitor Resource Usage<\/strong><\/h3>\n\n\n\n<p>Check usage with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemd-cgtop\nsystemctl status myfirst.slice<\/code><\/pre>\n\n\n\n<p>This helps track CPU and memory usage in real time.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-small-font-size\" id=\"h-conclusion\"><strong>Conclusion<\/strong><\/h4>\n\n\n\n<p>systemd slices and scopes provide a useful way to manage system resources in Ubuntu. Slices help organize services into groups and apply shared limits, while scopes allow control of external processes. By using these features, we can ensure that important applications get enough resources and prevent others from consuming too much. We can build a more stable, efficient, and well-managed system with proper use of slices and scopes.<\/p>\n\n\n\n<p>If you\u2019re looking to implement systemd resource management effectively or need expert help optimizing your infrastructure, partnering with a reliable provider can make all the difference. At Skynats, our <a href=\"https:\/\/www.skynats.com\/server-management\">server management services<\/a> and <a href=\"https:\/\/www.skynats.com\/linux-server-management\">linux server management services<\/a> are designed to help businesses streamline resource usage, improve performance, and maintain system stability. Get in touch with our team today to simplify your server operations and ensure your Ubuntu environment runs at its best.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Managing system resources like CPU and memory is very important for maintaining a stable and efficient server. In Ubuntu, systemd resource management helps control how processes use these resources through a feature called cgroups (control groups). Two important components of this system are slices and scopes. These help organize processes and apply resource limits [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1010,302,1279,1280,236,1281],"class_list":["post-17536","post","type-post","status-publish","format-standard","hentry","category-blog","tag-linux-server-management-services","tag-server-management-services","tag-systemd","tag-systemd-resource-management","tag-ubuntu","tag-ubuntu-os"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Systemd Resource Management on Ubuntu: Easy Guide<\/title>\n<meta name=\"description\" content=\"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Manage Resources with systemd on Ubuntu?\" \/>\n<meta property=\"og:description\" content=\"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Server Management Services | Cloud Management | Skynats\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/skynats\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-16T04:34:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-16T04:34:16+00:00\" \/>\n<meta name=\"author\" content=\"Merin John\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:site\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Merin John\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/\"},\"author\":{\"name\":\"Merin John\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/b80e05405ba11197c3f60db56df40ded\"},\"headline\":\"How to Manage Resources with systemd on Ubuntu?\",\"datePublished\":\"2026-04-16T04:34:13+00:00\",\"dateModified\":\"2026-04-16T04:34:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/\"},\"wordCount\":429,\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"keywords\":[\"linux server management services\",\"server management services\",\"systemd\",\"systemd resource management\",\"Ubuntu\",\"Ubuntu OS\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/\",\"name\":\"Systemd Resource Management on Ubuntu: Easy Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-04-16T04:34:13+00:00\",\"dateModified\":\"2026-04-16T04:34:16+00:00\",\"description\":\"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-manage-resources-with-systemd-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Manage Resources with systemd on Ubuntu?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"name\":\"Server Management Services | Cloud Management | Skynats\",\"description\":\"Server Management and Cloud Management\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\",\"name\":\"Skynats Technologies\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"contentUrl\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"width\":989,\"height\":367,\"caption\":\"Skynats Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/skynats\",\"https:\\\/\\\/x.com\\\/skynatstech\",\"https:\\\/\\\/www.instagram.com\\\/skynatstech\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/skynats-technologies\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCvTAjrFJ4_E2MJKwlDHomlg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/b80e05405ba11197c3f60db56df40ded\",\"name\":\"Merin John\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g\",\"caption\":\"Merin John\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Systemd Resource Management on Ubuntu: Easy Guide","description":"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Manage Resources with systemd on Ubuntu?","og_description":"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!","og_url":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/","og_site_name":"Server Management Services | Cloud Management | Skynats","article_publisher":"https:\/\/www.facebook.com\/skynats","article_published_time":"2026-04-16T04:34:13+00:00","article_modified_time":"2026-04-16T04:34:16+00:00","author":"Merin John","twitter_card":"summary_large_image","twitter_creator":"@skynatstech","twitter_site":"@skynatstech","twitter_misc":{"Written by":"Merin John","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/"},"author":{"name":"Merin John","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/b80e05405ba11197c3f60db56df40ded"},"headline":"How to Manage Resources with systemd on Ubuntu?","datePublished":"2026-04-16T04:34:13+00:00","dateModified":"2026-04-16T04:34:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/"},"wordCount":429,"publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"keywords":["linux server management services","server management services","systemd","systemd resource management","Ubuntu","Ubuntu OS"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/","url":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/","name":"Systemd Resource Management on Ubuntu: Easy Guide","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/#website"},"datePublished":"2026-04-16T04:34:13+00:00","dateModified":"2026-04-16T04:34:16+00:00","description":"Learn systemd resource management on Ubuntu to control CPU, memory, and processes efficiently. Follow this easy step-by-step guide!","breadcrumb":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skynats.com\/blog\/how-to-manage-resources-with-systemd-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skynats.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Manage Resources with systemd on Ubuntu?"}]},{"@type":"WebSite","@id":"https:\/\/www.skynats.com\/blog\/#website","url":"https:\/\/www.skynats.com\/blog\/","name":"Server Management Services | Cloud Management | Skynats","description":"Server Management and Cloud Management","publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skynats.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skynats.com\/blog\/#organization","name":"Skynats Technologies","url":"https:\/\/www.skynats.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","contentUrl":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","width":989,"height":367,"caption":"Skynats Technologies"},"image":{"@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/skynats","https:\/\/x.com\/skynatstech","https:\/\/www.instagram.com\/skynatstech\/","https:\/\/www.linkedin.com\/company\/skynats-technologies","https:\/\/www.youtube.com\/channel\/UCvTAjrFJ4_E2MJKwlDHomlg"]},{"@type":"Person","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/b80e05405ba11197c3f60db56df40ded","name":"Merin John","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c6fda6ca622259bc47ba01df18b391ee9e0540db86283334dea33951c4fa19b8?s=96&d=mm&r=g","caption":"Merin John"}}]}},"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=17536"}],"version-history":[{"count":2,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17536\/revisions"}],"predecessor-version":[{"id":17538,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17536\/revisions\/17538"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=17536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=17536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=17536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}