{"id":243,"date":"2023-01-15T21:09:22","date_gmt":"2023-01-15T21:09:22","guid":{"rendered":"https:\/\/dretch.com\/?p=243"},"modified":"2023-01-18T20:47:14","modified_gmt":"2023-01-18T20:47:14","slug":"linux-server-power-tuning-pt-1","status":"publish","type":"post","link":"https:\/\/dretch.com\/?p=243","title":{"rendered":"Linux Server Power Tuning (pt.1)"},"content":{"rendered":"\n<\/H3>Listening to: <a href=\"https:\/\/escortpunx.bandcamp.com\/releases\">Demo 2017 &#8211; Escort<\/a> (great live show btw!)<\/H3>\n\n\n\n<p><\/p>\n\n\n\n<p>From measuring my electric scooter&#8217;s power consumption to the &#8220;rest&#8221; mode draw of my PS4, diving into energy savings has been a bit of an obsession of late. Dork, ahead, you&#8217;re been warned :-).<\/p>\n\n\n\n<p>I have a older dual core <a href=\"https:\/\/en.wikipedia.org\/wiki\/Next_Unit_of_Computing\">Celeron Intel NUC<\/a> running 24\/7 in the house. It hosts  <a href=\"https:\/\/nextcloud.com\/\">NextCloud<\/a> and phone backups along with a <a href=\"https:\/\/jellyfin.org\/\">Jellyfin<\/a> server for streaming my music collection. This is not traditionally exposed to the internet but is accessed via a &#8220;<a href=\"https:\/\/www.csoonline.com\/article\/3575088\/mesh-vpns-explained-another-step-toward-zero-trust-networking.html\">open-source software defined mesh virtual private network<\/a>&#8220;. Big words but the basics have become simple to implement (see <a href=\"https:\/\/tailscale.com\/\">Tailscale<\/a> or <a href=\"https:\/\/slack.engineering\/introducing-nebula-the-open-source-global-overlay-network-from-slack\/\">Nebula<\/a>).<\/p>\n\n\n\n<p>Time to look at the power this device consumes. It&#8217;s about optimizing really, as the <a href=\"https:\/\/science.howstuffworks.com\/environmental\/green-tech\/sustainable\/kill-a-watt1.htm\">Kill-a-watt<\/a> can barely measure it&#8217;s draw.<\/p>\n\n\n\n<p>Nested down in \/sys\/devices\/system\/cpu\/cpuX\/cpufreq\/ is a config file called &#8220;scaling_governor&#8221;. Mine has a single entry called &#8220;schedutil&#8221;. Looking over the definitions at <a href=\"https:\/\/www.kernel.org\/doc\/html\/v4.14\/admin-guide\/pm\/cpufreq.html\">kernel.org<\/a> it seems indeed, that is what I want set.<\/p>\n\n\n\n<p>I found an article called &#8220;<a href=\"https:\/\/bigstep.com\/blog\/go-green-how-to-optimize-server-power-usage-with-powertop\">Go Green: How to Optimize Server Power Usage with PowerTOP<\/a>&#8221; which sounded promising, and indeed it was. <\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/fenrus75\/powertop\">PowerTOP<\/a> is a command line tool that works on a variety of architectures. It allows you to evaluate processes and hardware in your system and even recommends &#8220;fixes&#8221; to improve matters. These can be automated via PowerTOP or implemented manually on the system.<\/p>\n\n\n\n<p>On my small device running <a href=\"https:\/\/ubuntu.com\/download\/server\">Ubuntu 22.04.1<\/a> 29 items as &#8220;good&#8221; and 9 items that needed attention:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VM writeback timeout<\/li>\n\n\n\n<li>NMI watchdog should be turned off<\/li>\n\n\n\n<li> Autosuspend for USB device ThinkPad Keyboard<\/li>\n\n\n\n<li>6 devices that should have Runtime Power Management enabled<\/li>\n<\/ul>\n\n\n\n<p>Not yet knowing what effect &#8220;fixing&#8221; these items will have (and, &lt;cough&gt; what some of them are), it&#8217;s time to image the system before proceeding. <\/p>\n\n\n\n<p>A part 2 may be forthcoming. Wish me luck :-).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Listening to: Demo 2017 &#8211; Escort (great live show btw!) From measuring my electric scooter&#8217;s power consumption to the &#8220;rest&#8221; mode draw of my PS4, diving into energy savings has been a bit of an obsession of late. Dork, ahead, you&#8217;re been warned :-). I have a older dual core Celeron Intel NUC running 24\/7 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":245,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,6,5],"tags":[],"class_list":["post-243","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-environment","category-learning","category-tech"],"_links":{"self":[{"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/posts\/243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dretch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=243"}],"version-history":[{"count":4,"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions"}],"predecessor-version":[{"id":255,"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions\/255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dretch.com\/index.php?rest_route=\/wp\/v2\/media\/245"}],"wp:attachment":[{"href":"https:\/\/dretch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dretch.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dretch.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}