{"id":93660,"date":"2023-06-23T16:48:36","date_gmt":"2023-06-23T16:48:36","guid":{"rendered":"https:\/\/www.techrepublic.com\/?p=4105589"},"modified":"2023-06-23T16:48:36","modified_gmt":"2023-06-23T16:48:36","slug":"how-to-scale-docker-swarm-services","status":"publish","type":"post","link":"https:\/\/cloudnewshub.com\/?p=93660","title":{"rendered":"How to scale Docker Swarm services"},"content":{"rendered":"<div><img decoding=\"async\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/06\/how-to-scale-docker-swarm-services.jpg\" class=\"ff-og-image-inserted\"><\/div>\n<div id>\n<p> Jack Wallen demonstrates how to attach and remove nodes from clusters in Docker Swarm to scale your services up and down as needed. <\/p>\n<\/div>\n<div id>\n<p>[embedded content]<\/p>\n<p>If Docker Swarm is your container cluster technology of choice, you\u2019re going to want to know how to scale up and down the services you deploy.<\/p>\n<p>When you need more power to meet a higher demand, scale those services up. When demand lowers during off-peak hours, scale them down. This is a great way to help keep costs down, especially when your containers are hosted on a third-party service such as Google, AWS or Azure.<\/p>\n<p>You might be surprised to find out that scaling services up and down on Docker Swarm is actually quite easy. In fact, it\u2019s done with a single command, and you only need to change the number of nodes the service will scale to.<\/p>\n<aside class=\"pinbox right\">\n<h3 class=\"heading\">Must-read developer coverage<\/h3>\n<\/aside>\n<p>As for the scalability, it is limited to the number of nodes you have attached to the cluster. For example, if you have 100 nodes attached to the Swarm, your maximum scale would be 100. If you only have 3 nodes, your max is 3. Let me show you how it\u2019s done.<\/p>\n<p>I\u2019ll demonstrate with a previously deployed service called nginx_test.<\/p>\n<p>Check how many nodes the service has been deployed to with the command docker service list. As you can see, nginx_test has only been deployed to 1 node.<\/p>\n<p>Let\u2019s up that to 3 nodes with the command docker service scale nginx_test=3. You can then verify the service scaled with the command docker service list. This time it should show nginx_test on 3\/3 nodes.<\/p>\n<p>When it comes time to scale that service back down, the command is similar to when you scaled it up, only we\u2019ll use 1 instead of 3, as in docker service scale nginx_test=1.<\/p>\n<p>And that\u2019s all there is to scaling a service on Docker Swarm up or down. Use this feature wisely to ensure your services can meet increased demand when needed.<\/p>\n<p><b><i>Subscribe to TechRepublic\u2019s <\/i><\/b><a href=\"https:\/\/www.youtube.com\/channel\/UCKyMiy1zmJ7aZ8aP6DLZLIA\"><b><i>How To Make Tech Work<\/i><\/b><\/a><b><i>&nbsp;on YouTube for all the latest tech advice for business pros from Jack Wallen.<\/i><\/b><\/p>\n<p> <!-- default newsletter at the end --> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Jack Wallen demonstrates how to attach and remove nodes from clusters in Docker Swarm to scale your services up and down as needed. [embedded content] If Docker Swarm is your container cluster technology of choice, you\u2019re going to want to know how to scale up and down the services you deploy. When you need more [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93661,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,783],"tags":[],"class_list":["post-93660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-cloudsync"],"_links":{"self":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/93660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93660"}],"version-history":[{"count":0,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/93660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/media\/93661"}],"wp:attachment":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}