<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Conrad&#39;s blog</title>
    <link>https://logs.eu.org/</link>
    <description>Recent content on Conrad&#39;s blog</description>
    <image>
      <title>Conrad&#39;s blog</title>
      <url>https://logs.eu.org/images/avatar.png</url>
      <link>https://logs.eu.org/images/avatar.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 06 Oct 2022 22:25:01 +0800</lastBuildDate>
    <atom:link href="https://logs.eu.org/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Dynamic Memory Management - Proxmox VE</title>
      <link>https://logs.eu.org/posts/pve/dynamic-memory-management---proxmox-ve/</link>
      <pubDate>Thu, 06 Oct 2022 22:25:01 +0800</pubDate>
      <guid>https://logs.eu.org/posts/pve/dynamic-memory-management---proxmox-ve/</guid>
      <description>&lt;h1 id=&#34;dynamic-memory-management-动态内存管理&#34;&gt;Dynamic Memory Management 动态内存管理&lt;/h1&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Optimized and effective memory management is a key factor in virtualization environments. KSM and Auto-Ballooning enables sophisticated and economic configurations for physical RAM utilization.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;优化和有效的内存管理是虚拟环境的关键因素，KSM和Auto-Ballooning为物理内存管理提供了复杂且实用的配置。&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;ksm&#34;&gt;KSM&lt;/h2&gt;
&lt;p&gt;KSM (Kernel Samepage Merging) is running in the Linux kernel and scans the memory of all the virtual machines running on a single host, looking for duplication and consolidating. With KSM we&amp;rsquo;re able to improve virtual machine density by as much as 300% without impacting performance. One of the great benefits of using Linux as the hypervisor means KSM is not limited to KVM and virtual machines, but can also reduce memory pressure with normal Linux applications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create a Swap File on Linux</title>
      <link>https://logs.eu.org/posts/make-swapfile/</link>
      <pubDate>Thu, 11 Aug 2022 01:21:50 +0800</pubDate>
      <guid>https://logs.eu.org/posts/make-swapfile/</guid>
      <description>&lt;p&gt;A swap file lets the kernel move idle pages out of RAM onto disk. It&amp;rsquo;s handy on
small-memory hosts (VPS, VMs) that have no dedicated swap partition, and unlike a
partition it can be resized or removed without repartitioning.&lt;/p&gt;
&lt;h3 id=&#34;create-the-swap-file&#34;&gt;Create the swap file&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Allocate a 1 GiB file. dd is preferred over fallocate here because&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# swapon rejects files with holes on some filesystems (e.g. ext4, XFS).&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;dd &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&#34;nv&#34;&gt;of&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;/swapfile &lt;span class=&#34;nv&#34;&gt;bs&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;1M &lt;span class=&#34;nv&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;status&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;progress
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;chmod &lt;span class=&#34;m&#34;&gt;0600&lt;/span&gt; /swapfile   &lt;span class=&#34;c1&#34;&gt;# only root may read/write the swap file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkswap /swapfile       &lt;span class=&#34;c1&#34;&gt;# format it as swap space&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;swapon /swapfile       &lt;span class=&#34;c1&#34;&gt;# enable it immediately&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id=&#34;make-it-persistent&#34;&gt;Make it persistent&lt;/h3&gt;
&lt;p&gt;Add an entry to &lt;code&gt;/etc/fstab&lt;/code&gt; so the swap file is mounted on every boot. The
&lt;code&gt;grep&lt;/code&gt; guard keeps this idempotent — running it twice won&amp;rsquo;t add a duplicate line.&lt;/p&gt;</description>
    </item>
    <item>
      <title>My First Post</title>
      <link>https://logs.eu.org/posts/my-first-post/</link>
      <pubDate>Fri, 05 Aug 2022 16:24:31 +0800</pubDate>
      <guid>https://logs.eu.org/posts/my-first-post/</guid>
      <description>&lt;p&gt;Hello world&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>About Me</title>
      <link>https://logs.eu.org/about/</link>
      <pubDate>Fri, 05 Aug 2022 01:03:03 +0800</pubDate>
      <guid>https://logs.eu.org/about/</guid>
      <description>&lt;p&gt;This is my first static blog.&lt;/p&gt;
&lt;p&gt;Just try it.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
