{"id":2160,"date":"2025-01-03T19:26:38","date_gmt":"2025-01-04T00:26:38","guid":{"rendered":"https:\/\/www.unliterate.net\/?p=2160"},"modified":"2025-01-03T19:27:29","modified_gmt":"2025-01-04T00:27:29","slug":"server-problems-2025","status":"publish","type":"post","link":"https:\/\/www.unliterate.net\/index.php\/2025\/01\/03\/server-problems-2025\/","title":{"rendered":"Server Problems, 2025&#8230;"},"content":{"rendered":"\n<p>After <a href=\"\/index.php\/2024\/10\/20\/gettin-hacked\/\">Gettin&#8217; hacked<\/a> and rebuilding with a cheaper server I started encountering random slowness and problems. I always seemed to have random CPU spikes here and there but the console at digitalocean didn&#8217;t really give me much to work with. <\/p>\n\n\n\n<p>Today I tried to install git so I can get some repos cloned down to demo and the process kept getting Killed. After some simple googling and basic cross referencing of the system I&#8217;m leasing I learned the stupidest thing in the world.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>When you get yourself a VM though digitalocean it seems to be built for optimization. You&#8217;ve purchased enough disk space for what you need to store and enough RAM to run programs that you need to run. This implies that the disk space is 100% allocated to storage, nothing more. This means no Virtual Memory, so no swapping, and no problems.<\/p>\n\n\n\n<p>So, I leared I have to create an actual swap file, enable it, and tweak it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fallocate -l 2G \/swapfile\nsudo chmod 600 \/swapfile\nsudo mkswap \/swapfile\nsudo swapon \/swapfile\nsudo swapon --show\nsudo cp \/etc\/fstab \/etc\/fstab.bak\necho '\/swapfile none swap sw 0 0' | sudo tee -a \/etc\/fstab\nsudo sysctl vm.swappiness=10\necho 'vm.swappiness=10' | s<sup data-fn=\"e123b8c2-84b2-404e-adfd-d6e52dc164aa\" class=\"fn\"><a href=\"#e123b8c2-84b2-404e-adfd-d6e52dc164aa\" id=\"e123b8c2-84b2-404e-adfd-d6e52dc164aa-link\">1<\/a><\/sup>udo tee -a \/etc\/sysctl.conf\nsudo sysctl vm.vfs_cache_pressure=50\necho 'vm.vfs_cache_pressure=50' | sudo tee -a \/et<sup data-fn=\"d60dfcdd-1a41-4197-8c4d-5046da3d5ff2\" class=\"fn\"><a href=\"#d60dfcdd-1a41-4197-8c4d-5046da3d5ff2\" id=\"d60dfcdd-1a41-4197-8c4d-5046da3d5ff2-link\">2<\/a><\/sup>c\/sysctl.conf<\/code><\/pre>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"e123b8c2-84b2-404e-adfd-d6e52dc164aa\"><a href=\"https:\/\/unix.stackexchange.com\/questions\/98025\/yum-update-shows-killed\">https:\/\/unix.stackexchange.com\/questions\/98025\/yum-update-shows-killed<\/a> <a href=\"#e123b8c2-84b2-404e-adfd-d6e52dc164aa-link\" aria-label=\"Jump to footnote reference 1\">\u21a9\ufe0e<\/a><\/li><li id=\"d60dfcdd-1a41-4197-8c4d-5046da3d5ff2\"><a href=\"https:\/\/stackoverflow.com\/questions\/49228066\/npm-install-via-digital-ocean-gets-killed\">https:\/\/stackoverflow.com\/questions\/49228066\/npm-install-via-digital-ocean-gets-killed<\/a> <a href=\"#d60dfcdd-1a41-4197-8c4d-5046da3d5ff2-link\" aria-label=\"Jump to footnote reference 2\">\u21a9\ufe0e<\/a><\/li><\/ol>\n\n\n<p>Once this was all done and set up to be mounted on reboot, with the mild sysctl optimizations I was able to do the next best thing. I&#8217;m also sure that swapping is not a good thing, but since I&#8217;m going the cheapo route on things I&#8217;ll take whatever performance hit I can so I can keep on truckin&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After Gettin&#8217; hacked and rebuilding with a cheaper server I started encountering random slowness and problems. I always seemed to have random CPU spikes here and there but the console at digitalocean didn&#8217;t really give me much to work with. Today I tried to install git so I can get some repos cloned down to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"[{\"content\":\"<a href=\\\"https:\/\/unix.stackexchange.com\/questions\/98025\/yum-update-shows-killed\\\">https:\/\/unix.stackexchange.com\/questions\/98025\/yum-update-shows-killed<\/a>\",\"id\":\"e123b8c2-84b2-404e-adfd-d6e52dc164aa\"},{\"content\":\"<a href=\\\"https:\/\/stackoverflow.com\/questions\/49228066\/npm-install-via-digital-ocean-gets-killed\\\">https:\/\/stackoverflow.com\/questions\/49228066\/npm-install-via-digital-ocean-gets-killed<\/a>\",\"id\":\"d60dfcdd-1a41-4197-8c4d-5046da3d5ff2\"}]"},"categories":[19,20,17],"tags":[],"class_list":["post-2160","post","type-post","status-publish","format-standard","hentry","category-centos","category-geek-instructions","category-linux"],"_links":{"self":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/2160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/comments?post=2160"}],"version-history":[{"count":2,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/2160\/revisions"}],"predecessor-version":[{"id":2163,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/2160\/revisions\/2163"}],"wp:attachment":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/media?parent=2160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/categories?post=2160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/tags?post=2160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}