<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PePoDev]]></title><description><![CDATA[A man who loves technology and games ❤️]]></description><link>https://blog.pepo.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 00:51:47 GMT</lastBuildDate><atom:link href="https://blog.pepo.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AWS Graviton ทักครับ 👋]]></title><description><![CDATA[ภาพรวมของ AWS Graviton ที่ให้ประสิทธิภาพแรงขึ้นแต่ราคาถูกลง บ้าไปแล้ววววว]]></description><link>https://blog.pepo.dev/aws-graviton</link><guid isPermaLink="true">https://blog.pepo.dev/aws-graviton</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS Graviton Processors]]></category><category><![CDATA[EKS cluster]]></category><category><![CDATA[ARM]]></category><category><![CDATA[EKS]]></category><dc:creator><![CDATA[Thiwanon Chomcharoen]]></dc:creator><pubDate>Sun, 14 Jan 2024 13:14:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/PVr9Gsj93Pc/upload/2572538fabc282154a31747f92d050a8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>เห็นคำว่า Graviton นี่เราไม่ได้หมายถึงแรงโน้มถ่วงควอนตัมแต่อย่างใด แต่เรากำลังพูดถึง AWS Graviton กันอยู่ ซึ่งถ้าเอาแบบง่ายๆ AWS Graviton ก็คือ CPU Arm-based processors ของทาง AWS ซึ่งเป็นหนึ่งใน <a target="_blank" href="https://aws.amazon.com/silicon-innovation/">AWS custom chips</a> ที่มีจุดเด่นในด้านของราคาต่อประสิทธิภาพ</p>
<p>ปัจจุบันเวอร์ชั่นล่าสุดของ AWS Graviton คือ Generation 4 ที่เพิ่งเปิดตัวกันไปในงาน <a target="_blank" href="https://reinvent.awsevents.com/">AWS re:Invent 2023</a> ที่ผ่านมา (ขณะนี้อยู่ใน preview สามารถ <a target="_blank" href="https://aws.amazon.com/ec2/instance-types/r8g/">signup</a> เผื่อทดลองใช้งานได้) ซึ่งมีการปรับปรุงในเรื่องของ performance และ cost-effective ที่มากขึ้น</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690887859525/77cbdcde-8ab2-4b20-b451-15ee8d19f196.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-graviton">ประสิทธิภาพของ Graviton</h2>
<p>ถ้าถามว่า อะไรที่ทำให้ AWS Graviton แรงกว่า คุ้มกว่า เรามาลองดูรูปนี้กันครับ</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*DnJf_B0U5mhjTrdWvgUxYA.png" alt /></p>
<p>จากรูปนี้เราจะเห็นอยู่สองเรื่องนั่นก็คือ</p>
<ol>
<li><p>Every vCPU is a full core - หมายความว่าโดยปกติแล้ว vCPU ที่เราเห็นๆกันมันเป็นแค่ thread (logical core) ไม่ใช่ physical core ซึ่งจริงๆแล้วเป็นการทำสิ่งที่เรียกว่า <a target="_blank" href="https://en.wikipedia.org/wiki/Simultaneous_multithreading">Simultaneous Multithreading</a> หรือ <a target="_blank" href="https://en.wikipedia.org/wiki/Hyper-threading">hyperthreading</a> ฉะนั้นเวลาที่ต้องประมวลผล workload จำนวนมาก อาจทำให้เกิด latency ขึ้นระหว่าง logical core ด้วยกันเองได้ [<a target="_blank" href="https://www.linkedin.com/pulse/understanding-physical-logical-cpus-akshay-deshpande/">Core and Thread</a>]</p>
</li>
<li><p>Uniform memory access - คือการที่ processor มี local memory เป็นของตัวเอง ไม่แชร์ข้ามระหว่างกัน ทำให้สามารถ access ได้ไวกว่า non-local memory [<a target="_blank" href="https://en.wikipedia.org/wiki/Non-uniform_memory_access">Memory Design NUMA</a>]</p>
</li>
</ol>
<p>ถ้าหากว่าใครไหวเรื่องพวกนี้แนะนำให้ไปต่อกับ <a target="_blank" href="https://docs.aws.amazon.com/whitepapers/latest/ec2-networking-for-telecom/overview-of-performance-optimization-options.html">AWS whitepaper</a> อันนี้ได้เลยครับ<br />ส่วนตัวผมนั้น ไม่ไหวครับ 🥲</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704278358907/5ca82b29-9024-4268-be5e-9c97ab8f5b15.png" alt class="image--center mx-auto" /></p>
<p>ด้วยสองเหตุผลที่กล่าวไปทำให้เราสามารถรีดประสิทธิภาพของ CPU ได้มากขึ้น แทบจะ 100% กันเลยทีเดียว ต่างจาก x86 ที่จะเริ่มมี Latency มากขึ้นเรื่อยๆเพราะ Physical core ถูกแบ่งกันใช้งาน ทำให้เราต้องมาตั้ง trigger scaling ตั้งแต่เนิ่นๆก่อนที่จะเกิด Bottleneck กันอย่างในปัจุบัน</p>
<p>ถัดไปลองมาดู Benchmark กันบ้างครับ</p>
<p><a target="_blank" href="https://www.anandtech.com/show/15578/cloud-clash-amazon-graviton2-arm-against-intel-and-amd/9"><img src="https://images.anandtech.com/doci/15578/perf-per-usd_575px.png" alt /></a></p>
<p>รูปนี้ก็เป็น Benchmark ของทาง <a target="_blank" href="https://www.anandtech.com/show/15578/cloud-clash-amazon-graviton2-arm-against-intel-and-amd/9">Anandtech</a> ที่ทำเทียบระหว่าง AWS Graviton 2 กับ x86 ทั้งทางฝั่ง AMD และ Intel ครับ จะเห็นได้ว่าในจำนวนเงิน dollar ที่จ่ายไปเท่ากันนั้น การใช้งาน AWS Graviton สามารถให้ผลลัพธ์ที่ค่อนข้างมากกว่านั่นเอง และหากมาลองดู real world scenario ที่เราใช้กันอย่างเช่น Nginx ก็ยังให้ Requests/Sec ที่มากกว่าเช่นกัน</p>
<p><a target="_blank" href="https://www.nginx.com/resources/datasheets/nginx-plus-arm-based-aws-graviton2-amis/"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704281279881/b7397fb1-8e68-4e0d-ba33-330ee0acf237.png" alt class="image--center mx-auto" /></a></p>
<p>ลองมาดู feedback จากลูกค้าที่ใช้ AWS Graviton กันบ้างครับ</p>
<p><img src="https://cdn2.unrealengine.com/UnrealEngine%2FNews%2FAnnouncing+the+Epic+Games+Store%2FFB_EpicGamesStore-1200x630-ca750cd84e1b60d746606db9e5a5ac55f8d27672.jpg" alt="Announcing the Epic Games Store - Unreal Engine" /></p>
<blockquote>
<p>"AWS Graviton4 instances are the fastest EC2 instances we've evert tested and are delivering outstanding performance across our most competitive and latency sensitive workloads. we look forward to using Graviton4 to improve player experience and expand what is possible within Fortnite."</p>
<p>Epic Game</p>
</blockquote>
<p><img src="https://mma.prnewswire.com/media/1730117/Datadog_logo.jpg?p=facebook" alt="Datadog Launches Universal Service Monitoring" /></p>
<blockquote>
<p>"Integrating Graviton4-based instances into our environment was seamless and gave us an immediate performance boost out of the box, and we're looking forward to using Graviton4 when it becomes generally available"</p>
<p>Datadog</p>
</blockquote>
<p><img src="https://b.stripecdn.com/site-statics-srv/assets/assets/img/v3/home/social-9755e0835b1ab1538bddad515c24744b.png" alt="Stripe: Local payment methods pricing" /></p>
<blockquote>
<p>"Measured up to 50% query performance improvement and 10%-15% reduced error rate (fewer timeouts)"</p>
<p>Stripe</p>
</blockquote>
<p>อันนี้ก็เป็นแค่ตัวอย่างที่เราหยิบยกมาเบื้องต้นแค่นั้น จะเห็นได้ว่าหลายๆบริษัทสามารถนำ AWS Graviton มาใช้เพื่อเพิ่มประสิทธิภาพของระบบได้มากขึ้นเลยทีเดียว ถ้าหากว่าอยากอ่านเพิ่มเติม สามารถเข้าไปดูลูกค้าของ AWS Graviton เต็มๆได้<a target="_blank" href="https://aws.amazon.com/ec2/graviton/customers/?ec2-instances-customers-cards.sort-by=item.additionalFields.date-added&amp;ec2-instances-customers-cards.sort-order=desc&amp;awsf.success-story-topic=*all&amp;awsf.content-type=*all&amp;awsf.use-case=*all&amp;awsf.processor=*all&amp;awsf.instance-name=*all&amp;awsf.managed-services=*all&amp;awsf.programming-language=*all&amp;awsf.industry=*all&amp;awsf.region=*all&amp;awsf.year=*all">ที่นี่</a>เลยครับ</p>
<h2 id="heading-graviton-1">การใช้งาน Graviton</h2>
<p>เกริ่นกันมาซะขนาดนี้ คิดว่าทุกคนคงอยากจะกระโดดเข้ามาใช้งานเจ้า CPU ตัวนี้ของ AWS กันเป็นแน่แท้ งั้นไม่รอช้าครับ เรามาดูกันดีกว่าว่าก่อนที่เราจะใช้งานเจ้า Graviton นี้ได้ เราต้องเตรียมความพร้อมอะไรกันบ้าง</p>
<h3 id="heading-1-cpu-architecture">1/ CPU Architecture</h3>
<p>เนื่องด้วยความต่างของ CPU Architecture ทำให้เราต้องมีการเตรียมความพร้อมสำหรับการนำ software ไปรันอยู่บน AWS Graviton กันก่อนครับ สามารถเช็คไปทีล่ะข้อได้เลยตามรายการด้านล่างนี้ได้เลยครับ</p>
<ul>
<li><p>Language - ถ้าหากว่าภาษา programming ที่คุณใช้เป็นประเภทที่ต้อง compile ก่อน เช่น C, C++, GO, หรือ Rust ก็สามารถเปลี่ยนมา compile สำหรับ ARM64 Architecture ได้เลยครับ หรือถ้าภาษาที่ใช้เป็น Interpreted หรือ Compiled-bytecode เช่น Python, Java, PHP, Node.js หรือ .NET ก็แค่เปลี่ยนตัว runtime ให้เป็นของ ARM64 ก็เป็นอันเรียบร้อย จริงๆตอนที่เราทำเองอาจจะไม่ได้ง่ายขนาดนั้น ลองเข้าไปอ่านคำแนะนำเบื้องต้นของแต่ล่ะภาษาที่เราใช้งานกันได้เลยครับ</p>
<ul>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/c-c++.md">C/C++</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/golang.md">Go</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/java.md">Java</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/dotnet.md">.NET</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/php.md">PHP</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/python.md">Python</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/rust.md">Rust</a></p>
</li>
</ul>
</li>
</ul>
<p>    และเพื่อความมั่นใจก็ลองไปเช็ค <a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/rust.md">Known issues</a> กันก่อนซักเล็กน้อยเผื่อจะได้ไม่เสียเวลาไปกับปัญหาที่เราอาจจะเจอครับ</p>
<ul>
<li>Operating System - ปัจจุบันแทบจะทุก Linux distributions รองรับ ARM64 กันเป็นที่เรียบร้อย ถ้าหากคุณใช้ AMI มาตราฐานอย่าง Amazon Linux, Ubuntu, หรือ Alpine Linux ก็สบายใจได้ แต่ถ้าไม่หรือเป็นมีการปรับแต่งกันขึ้นมาเอง ก็อาจจะต้องไปดู <a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/os.md">Operating System</a> ที่รองรับกันนิดนึงว่ารองรับหรือไม่ครับ</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705165594735/5923553b-f025-4da1-ad58-6a827ac259cc.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Version - นอกจากการเปลี่ยนวิธีการ compile ของภาษาที่เราใช้แล้ว เราก็ควรจะอัพเกรดเวอร์ชั่นที่ใช้ให้ใหม่ที่สุดเท่าที่จะเป็นไปได้ด้วยเช่นกัน เพราะในตอนที่ยุคของ ARM computer มาถึง หลายๆภาษาก็เริ่มมีการ optimize ให้เข้ากับ ARM มากยิ่งขึ้น อย่างเช่น <a target="_blank" href="https://tip.golang.org/doc/go1.18">Go version 1.18</a> ที่มีการปรับปรุงการส่งฟังก์ชั่นเป็นอาร์กิวเมนต์ในรูปแบบใหม่ที่ทำให้ได้ performance มามากขึ้นกว่า 10% นั่นเอง</p>
<p>  <a target="_blank" href="https://aws.amazon.com/blogs/compute/making-your-go-workloads-up-to-20-faster-with-go-1-18-and-aws-graviton/"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705166990597/c069941d-705c-4952-ac70-4e61a071937b.png" alt class="image--center mx-auto" /></a></p>
<p>  ref: <a target="_blank" href="https://aws.amazon.com/blogs/compute/making-your-go-workloads-up-to-20-faster-with-go-1-18-and-aws-graviton/"><strong>Making your Go workloads up to 20% faster with Go 1.18 and AWS Graviton</strong></a></p>
</li>
</ul>
<h3 id="heading-2-workload-transition">2/ Workload Transition</h3>
<p>เมื่อ software ของเรานั้นรองรับการทำงานบน AWS Graviton กันเป็นที่เรียบร้อยแล้ว ถัดไปเราจะมาดูว่าการเปลี่ยน workload ของเราไปใช้เป็น AWS Graviton มีขั้นตอนเบื้องต้นยังไง ในที่นี้เราจะขอยกตัวอย่างเป็น AWS EKS ซึ่งเป็น Kubernetes Platform สำหรับบริหารและจัดการ Container workload ที่ใช้กันอย่างแพร่หลายในปัจจุบัน เมื่อพร้อมแล้วเรามาเริ่มกันที่</p>
<ul>
<li><p>Container Image</p>
<p>  จากข้อที่หนึ่ง เมื่อเราได้ทดลอง compile หรือเปลี่ยน runtime ของภาษาที่เราใช้งาน เราก็จะมาทำสิ่งที่เรียกว่า Multi-arch container images ที่ทำให้ Image ของเราทำงานได้บนหลาย CPU architectures (arm64 และ amd64) ซึ่งสามารถใช้เครื่องมืออย่าง <a target="_blank" href="https://github.com/docker/buildx#getting-started">Docker Buildx</a> มาช่วยในขั้นตอนนี้ได้เลยครับ</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705231794968/8f2220e3-1969-458e-a135-2494fb730a5c.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Deploy</p>
<p>  เมื่อ build เสร็จก็ต้อง deploy ถูกต้องไหมครับ ใน EKS เราสามารถสร้าง Node Group ใหม่โดยใช้ instance type ที่เป็นประเภท Graviton ได้เลย วิธีดูว่า Instance Type ไหนเป็น AWS Graviton ก็คือตัวลงท้ายในประเภทจะเป็นตัว <code>g</code> เช่น <code>t4g.medium</code>ครับ หลังจากนั้นเราก็ควร taint node group นี้ไว้ด้วยแล้วก็ค่อยไปใส่ toleration ให้ service ที่พร้อมสำหรับการรันบน AWS Graviton ถึงเข้ามาใช้งานได้ครับ</p>
<pre><code class="lang-yaml">  <span class="hljs-attr">tolerations:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">kubernetes.io/arch</span>
    <span class="hljs-attr">operator:</span> <span class="hljs-string">Equal</span>
    <span class="hljs-attr">value:</span> <span class="hljs-string">arm64</span>
    <span class="hljs-attr">effect:</span> <span class="hljs-string">NoSchedule</span>
</code></pre>
<p>  จริงๆแล้ววิธีการย้าย workload มีค่อนข้างหลากหลายครับ นอกจาก <a target="_blank" href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/">Taint and Toleration</a> ก็ยังมี <a target="_blank" href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/">Node label selector</a> และ <a target="_blank" href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/">Node affinity</a> อีกด้วย ซึ่งเราสามารถใช้งานร่วมกันเผื่อให้ได้ผลลัพธ์ตามที่ควรจะเป็นได้ครับ</p>
<p>  นอกจากการรันให้ถูก node แล้ว เรายังสามารถผสาน technique ที่เกี่ยวกับ <a target="_blank" href="https://gateway-api.sigs.k8s.io/guides/traffic-splitting/">Traffic splitting</a> ได้อีกด้วย ทำให้เราสามารถลองแบ่ง Traffic จำนวนหนึ่งมารันบน AWS Graviton เพื่อทำการทดสอบอะไรบางอย่างก่อนจะย้ายไปใช้จริง 100% ได้ครับ</p>
<p>  <a target="_blank" href="https://gateway-api.sigs.k8s.io/guides/traffic-splitting/"><img src="https://gateway-api.sigs.k8s.io/images/simple-split.png" alt="Traffic splitting" /></a></p>
</li>
<li><p>Testing</p>
<p>  เราจะรู้ได้ยังไงหล่ะว่าการมาใช้ AWS Graviton ทำให้ระบบเราได้ Performance ที่มากขึ้นและ Latency ลดลงเหมือนที่คนอื่นเขาเล่ากันมา คำตอบคือการทำ Testing ครับ หากว่าระบบเรามี script สำหรับการทำ Smoke Test เราก็สามารถนำมาทดลองรันกับ Service ที่ทำงานอยู่บน AWS Graviton เผื่อ Monitor ผลลัพธ์ได้เลยครับ</p>
<p>  อย่างไรก็ตาม การใช้งาน AWS Graviton ไม่ได้หมายความว่าเราจะได้ประสิทธิภาพเพิ่มขึ้นกันตลอดทุกครั้งนะครับ เพราะอย่างที่เรากล่าวกันไปในหัวข้อก่อน ว่าถ้าเวอร์ชั่นของภาษาที่เราใช้ยังไม่ได้ Optimize มาสำหรับ CPU ประเภท ARM อาจจะทำให้ประสิทธิภาพลดลงก็เป็นได้ โดยในส่วนนี้เราสามารถใช้เครื่องมือที่เรียกว่า <a target="_blank" href="https://github.com/brendangregg/FlameGraph">Flame Graphs</a> มาดู stack frame ของ application ว่ามันช้าลงที่ส่วนไหนเพื่อทำการ optimize เพิ่มเติมได้ครับ</p>
<p>  <img src="https://camo.githubusercontent.com/f60e00d56db631b9dba6be09615d0486760b7d38fee89021171134e340ba0495/687474703a2f2f7777772e6272656e64616e67726567672e636f6d2f466c616d654772617068732f6370752d626173682d666c616d6567726170682e737667" alt="Example" /></p>
</li>
</ul>
<p>ทั้งหมดนี้ก็เป็นเพียงขั้นตอนคร่าวๆเท่านั้น ทุกคนสามารถเข้าไปอ่านเรื่อง <a target="_blank" href="https://github.com/docker/buildx#getting-started">Transition Guide</a> เพิ่มเติมเพื่อขั้นตอนและวิธีการวางแผนที่ถูกต้องมากขึ้นครับ</p>
<h3 id="heading-3-managed-services">3/ Managed Services</h3>
<p>นอกจาก workload ของเราเองแล้ว เรายังสามารถใช้งานเจ้า Graviton กับ Managed services ต่างๆของ AWS ได้ด้วยนะ ซึ่งในส่วนนี้เราไม่ต้องทำอะไรเลยครับ สามารถ upgrade แล้วก็ enjoy ได้เลย ลองเข้าไปดูรายละเอียดของแต่ล่ะ <a target="_blank" href="https://github.com/aws/aws-graviton-getting-started/blob/main/managed_services.md">managed services</a> ที่เราต้องการใช้งานได้เลยครับ</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705073904825/0d550f44-b131-46e3-abc0-5ef578751593.png" alt="AWS re:Invent 2023 - AWS Graviton: The best price performance for your AWS workloads" class="image--center mx-auto" /></p>
<h2 id="heading-4liq4lij4li44lib">สรุป</h2>
<p>ถ้าหากว่าคุณเริ่มที่จะสนใจ AWS Graviton แล้วล่ะก็ ลองเข้าไปที่ <a target="_blank" href="https://aws.amazon.com/ec2/graviton/fast-start/">AWS Graviton Fast Start</a> ซึ่งเป็นโปรแกรมสำหรับการย้าย workload ของเรามาอยู่บน AWS Graviton ซึ่งมีตัวอย่างของ Serverless, Container, Database และ Caching ครับ</p>
<p><a target="_blank" href="https://aws.amazon.com/ec2/graviton/fast-start/"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705166657744/dc5fdaa3-0333-4295-bec5-3fd059e67a16.png" alt class="image--center mx-auto" /></a></p>
<p>ขอพลังของ ARM จงสถิตอยู่กับทุกคนครับ ⚔️</p>
<h3 id="heading-continue-readings">Continue readings</h3>
<ul>
<li><p><a target="_blank" href="https://github.com/aws/aws-graviton-getting-started">https://github.com/aws/aws-graviton-getting-started</a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/whitepapers/latest/aws-graviton2-for-isv/transitioning-your-service-or-application.html">https://docs.aws.amazon.com/whitepapers/latest/aws-graviton2-for-isv/transitioning-your-service-or-application.html</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[ผิดไหมถ้าใจอยากจะใช้ Arch Linux บน WSL]]></title><description><![CDATA[วิธีการติดตั้ง Linux distro ใดๆก็ตามที่เราต้องการลงบน WSL]]></description><link>https://blog.pepo.dev/arch-linux-wsl</link><guid isPermaLink="true">https://blog.pepo.dev/arch-linux-wsl</guid><category><![CDATA[WSL]]></category><category><![CDATA[ArchLinux]]></category><dc:creator><![CDATA[Thiwanon Chomcharoen]]></dc:creator><pubDate>Fri, 22 Dec 2023 17:40:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703266246115/f52421dd-89d5-4f42-a460-5e971498c57f.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-4lma4lib4lij4li04lmi4liz4liz4liz">เกริ่นนำ</h2>
<p>มีช่วงนึงที่เราหันไปใช้ Linux แบบจริงๆจังๆ จนเราได้ไปลอง Distro ตัวหนึ่งที่ชื่อ Arch Linux ในตอนนั้นเราก็ตกหลุมรักเข้ากับมนต์เสน่ห์แปลกๆของมัน ไม่ว่าจะการอัพเดตที่มีมาบ่อยจนรู้สึกหวาดกลัว หรือ package manager ที่แสนจะอัจฉริยะอย่างเจ้า pacman ทำให้เราต้องการนำมันกลับมาใช้งานใน WSL บนคอมเครื่องหลักของเรา แต่หลังจากที่ลอง search บน Windows Store เราเจอแต่ unofficial package ที่ไม่ได้อัพเดตมาหลายเดือนแล้ว เลยไปลองหาข้อมูลเพิ่มจนได้ใจความว่า ในปัจจุบันมี project open-source อยู่ตัวหนึ่งชื่อว่า <a target="_blank" href="https://github.com/yuk7/wsldl">wsldl</a> ที่เราไว้ติดตั้ง rootfs หรือ disk image (ext4 vhdx) ใดๆก็ตามลงใน WSL ซึ่งเขาก็ได้ทำ rootfs สำหรับ Arch Linux ไว้ด้วยให้เราใช้ติดตั้งลงบน WSL ได้เลย ซึ่ง Package บน Windows Store ที่เราเจอก็เอาอันนี้ไปใช้นี่แหละ แต่เดี๋ยวเราจะมาลงกันเองเพื่อความ up-to-date!</p>
<blockquote>
<p>สำหรับคนที่ไม่รู้จัก WSL มันก็คือเครื่องมือที่ช่วยให้นักพัฒนาสามารถใช้งานความสามารถของ Linux ได้โดยที่ไม่จ้องไปปวดหัวกับการทำ virtual machine หรือการทำ dual boot แต่ก็มาปวดหัวกับ WSL อยู่ดีนะ 😂</p>
</blockquote>
<h2 id="heading-4lil4lih4lih4li34lit">ลงมือ</h2>
<p>ด้วยความที่เจ้าของโปรเจ็คนี้ได้เตรียมอะไรหลายๆอย่างไว้ให้เราแล้ว ทำให้การติดตั้งนั้นมีหลายวิธีและค่อนข้างง่าย และในวันนี้เราจะใช้วิธีการติดตั้งผ่าน appx เพราะว่าง่ายมว๊าก เราสามารถทำตามขั้นตอนนี้ได้เลย</p>
<ol>
<li><p>เข้าไปดาวน์โหลด<a target="_blank" href="https://github.com/yuk7/ArchWSL/releases/latest">ตัวติดตั้ง</a>ที่เป็น <code>.appx</code> กับตัว <code>.cer</code> มาไว้ที่เครื่องเราซึ่งเราก็เลือกแบบ AppX หรือ Online-AppX ก็ได้จะแตกต่างแค่ Online จะเป็นไฟล์ขนาดนั้นเล็ก จะมีการโหลดเพิ่มระหว่างการติดตั้งเฉยๆ</p>
</li>
<li><p>พอทำการโหลดทุกอย่างเสร็จเรียบร้อยก็ทำการ Install Cer เข้าไปก่อนเผื่อเป็นการยืนยันว่าเราเชื่อถือผู้พัฒนานี้ ก็คลิกตาม <a target="_blank" href="https://wsldl-pg.github.io/ArchW-docs/Install-Certificate/">docs</a> นี้ได้เลย</p>
</li>
<li><p>ขั้นตอนสุดท้ายก็ดับเบิ้ลคลิก <code>.appx</code> เพื่อทำการ install ก็เป็นอันเสร็จพิธีครับ</p>
</li>
</ol>
<blockquote>
<p>appx ก็คือ package file ของ windows ที่เอาไว้ใช้แจกจ่ายสำหรับการติดตั้ง application ที่เป็น Universal Windows Platform (UWP) ส่วนมากใช้สำหรับนำแอพขึ้น Windows Store</p>
</blockquote>
<p>นอกจาก Arch Linux แล้ว เรายังสามารถเอา wsldl มาใช้ได้กับทุก distro ที่เราต้องการได้เลย สามารถใช้กับ CPU ประเภท ARM ได้อีกด้วย</p>
<p><img src="https://raw.githubusercontent.com/wiki/yuk7/wsldl/img/Arch_Alpine_Cent.png" alt="screenshot" /></p>
<p>ขอให้สนุกกับ WSL ครับ 👋</p>
<h2 id="heading-references">References</h2>
<ul>
<li><p><a target="_blank" href="https://learn.microsoft.com/en-us/windows/wsl/install">https://learn.microsoft.com/en-us/windows/wsl/install</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/yuk7/wsldl">https://github.com/yuk7/wsldl</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/yuk7/ArchWSL">https://github.com/yuk7/ArchWSL</a></p>
</li>
<li><p><a target="_blank" href="https://wsldl-pg.github.io/ArchW-docs/">https://wsldl-pg.github.io/ArchW-docs/</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Obsidian  กับเรื่อง Multiple-Devices]]></title><description><![CDATA[การเซ็ทอัพ Obsidian ให้ใช้งานได้ในหลายๆอุปกรณ์]]></description><link>https://blog.pepo.dev/obsidian-multiple-device</link><guid isPermaLink="true">https://blog.pepo.dev/obsidian-multiple-device</guid><category><![CDATA[obsidian sync]]></category><category><![CDATA[obsidian]]></category><category><![CDATA[syncthing]]></category><category><![CDATA[note-taking]]></category><dc:creator><![CDATA[Thiwanon Chomcharoen]]></dc:creator><pubDate>Fri, 22 Dec 2023 10:07:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1689139558133/9e007e52-cd05-4c5b-aeb7-00727329ff44.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-4lma4lib4lij4li04lmi4liz4liz4liz4lib4lix4liz4lil4lix4lib4liz4li04liu">เกริ่นนำกันซักนิด</h2>
<p>ถ้าหากคุณหลงเข้ามาโดยที่ยังไม่รู้ว่าเจ้า <a target="_blank" href="https://obsidian.md/">Obsidian</a> คืออะไร เราขอสรุปสั้นๆว่า Obsidian ก็คือ Note taking เจ้านึงที่เน้นเรื่อง Privacy first หรือก็คือ note ของเรา เราดูแลเอง บวกกับการจด Note ในแบบที่ Developer ชอบก็คือ Markdown style นั่นเอง เท่านั้นยังไม่พอ community ยังช่วยกันทำ plugin เพื่อให้เจ้า Obsidian มีความสามารถที่มากขึ้น ถือเป็น note taking app ที่มี feature ที่หลากหลาย ทำงานแบบ offline ได้ ที่สำคัญ ทั้งหมดที่กล่าวมานั้น ฟรี!!!!!!!!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1689138701906/71dffb2c-2404-4a4c-9159-7aafbcf9182a.png" alt class="image--center mx-auto" /></p>
<p>แต่เดี๋ยวก่อน ถึงแม้จะบอกว่าโปรแกรมนี้ฟรี แต่ก็มีจุดที่เขาหารายได้อยู่เหมือนกันด้วยการขายบริการหรือ add-ons แยกเพื่อใช้คู่กับ Obsidian ซึ่งมีอยู่สองส่วน ส่วนแรกก็คือระบบของการ Publish ที่จะช่วยให้เราสามาระแชร์ Note ของเราออกมาเป็น Link ที่สามารถเปิดดูได้ผ่าน Internet และส่วนที่สองคือการ Sync ที่จะช่วยให้โน๊ตของเราเหมือนกับ device เครื่องอื่นๆ เช่นแก้จากคอมไปดูในมือถือเป็นต้น</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1689139329663/76da04bb-8ff2-4eac-998f-a0974d839518.png" alt class="image--center mx-auto" /></p>
<p>ตอนนี้เราอาจจะมีคำถามว่า แล้วถ้าไม่อยากจ่ายเงินหล่ะ ไหนบอกฟรี? โอเค ไม่เป็นไร ผมมีข่าวดีสำหรับสาย Apple ทุกท่านก็คือ iCloud ใน iOS มัน mount file system ลงในเครื่องให้เลย ทำให้เราเปิด vault ของเราบน iCloud drive ได้ทั้งใน Mac แล้วก็ iPhone และ Sync กันได้เลยโดยที่ไม่ต้องทำอะไร แต่สำหรับสาย Android อย่างกระผมนั้นก็ไม่ต้องน้อยใจกันไป ตามมาดูวิธีต่างๆที่เราสามารถทำได้กัน</p>
<p>เป็นที่แน่นอนว่าถ้ามีระบบ plugin หรือการเก็บโน๊ตของเราลงบนเครื่องเราเองอยู่แล้ว เราย่อมมีทางเลือก ซึ่งวันนี้เราจะมาเสนอสี่ทางเลือกที่จะช่วยให้เราสามารถใช้งาน Obsidian บนหลายๆ device ได้พร้อมๆกัน (Publish ก็ทำแบบฟรีๆได้นะ แต่วันนี้เราจะมาโฟกัสกับการ Sync กันก่อน) เริ่มกันที่วิธีแรก</p>
<h3 id="heading-1-autosync">1/ <strong>Autosync</strong></h3>
<p>วิธีแรกคือการใช้ Cloud Storage อย่าง Google Drive เข้ามาช่วย Sync ข้อมูลให้เราโดยที่ใน PC หรือ Laptop เราก็ลงพวก File sync ของ Cloud ใดก็ได้ที่เราชื่อชอบ เช่น <a target="_blank" href="https://www.google.com/drive/download/">Google Drive for Desktop</a> หลังจากนั้นก็ใช้แอพ <a target="_blank" href="https://play.google.com/store/apps/details?id=com.ttxapps.drivesync">AutoSync</a> เข้ามาช่วย sync ข้อมูลเหล่านั้นมาลงบนโทรศัพท์ของเราได้เลย</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696586023607/fc7cc42c-8888-4842-bd96-6980699f849a.png" alt class="image--center mx-auto" /></p>
<p>สำหรับวิธีนี้ การตั้งค่าจะค่อนข้างง่าย เพียงแค่ login กับทาง Google Drive ทั้งสองอุปกรณ์ของเรา ตัว folder ก็จะเริ่ม Sync กันโดยอันตโนมัติ เพียงแต่ข้อเสียของวิธีคือมันไม่ real-time เพราะเราต้องตั้ง interval ว่าจะให้มันทำการ Sync ทุกๆกี่นาที ซึ่งถ้าเราตั้งถี่มากๆก็หมายถึง Battery ที่จะโดนสูบเข้าไปมากเช่นกัน หรือถ้าเราต้องการ sync มาทันทีก็ต้องมากด sync เองแบบ manual ครับ นอกจากแอพ AutoSync ก็ยังมีอีกเจ้านึงที่ชื่อ <a target="_blank" href="https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.lite">FolderSync</a> สามารถไปลองโหลดมาทดสอบกันดูได้เลยครับ</p>
<p>นี่ก็จบกันไปแล้วกับวิธีแรก ซึ่งถ้าหากว่าวิธีแรกมันง่ายไป เชิญคุณอ่านต่อไปได้เลยครับ แต่ถ้ามันยากไปคุณอาจจะต้องทบทวนว่าจะจ่ายเงินให้ Obsidian ดีไหมแทนแล้วหล่ะ เพราะหลังจากนี้จะเริ่มยากขึ้น และใช้ความรู้ทางด้านสายงาน IT พอสมควร ซึ่งจะมีความเสี่ยงต่อการสูญหายของข้อมูลด้วย หากคุณจัดการมันได้ไม่ดีพอ ถ้าคุณอ่านแล้วยังไม่กลัว ก็เชิญไปที่วิธีถัดไปได้เลยครับ</p>
<h3 id="heading-2-remotely-save-plugin">2/ Remotely Save (Plugin)</h3>
<p>อย่างที่กล่าวไปในตอนต้นว่า Obsidian เปิด API ให้นักพัฒนาสามารถเข้าไปทำ plugin เพื่อเสริมความสามารถได้เต็มที่ เลยทำให้มีคนทำ plugin ที่ชื่อว่า <a target="_blank" href="https://github.com/remotely-save/remotely-save">Remotely Save</a> ที่สามารถ Sync note ของเราเข้ากับ Cloud services ต่างๆได้ ซึ่งในปัจจุบันก็รองรับ S3, Dropbox, Webdav และ OneDrive ซึ่งการใช้งานก็เพียงแค่ติดตั้งและทำการ connect plugin เข้ากับ cloud service ที่เราต้องการก็เป็นที่เรียบร้อยแล้ว ที่เหลือเราก็เลือกได้เลยว่าต้องการให้ Sync ทุกๆกี่นาที หรือให้ทำการ Sync ทุกครั้งที่เปิดแอพขึ้นมาก็ได้เช่นกัน</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1697123231664/538c691d-bcf6-4c29-920e-32d616a85ec7.png" alt class="image--center mx-auto" /></p>
<p>เราอาจจะสังเกตว่าจะเริ่มมีคำเตือนมากขึ้นเมื่อเราเริ่มที่จะใช้ plugin เพราะการ Sync note ของเราระหว่างเครื่องอื่นๆก็คือการเขียนทับ ลบไฟล์ต่างในเครื่องของเรา ดังนั้นหากคุณหรือตัว plugin เองทำบางอย่างผิดพลาดไป ก็อาจจะเกิดการสูญหายของข้อมูลได้เช่นกัน ดังนั้นเราเลยต้องมีวิธี backup ข้อมูลของเราเช่นกัน</p>
<h3 id="heading-3-git-plugin">3/ Git (Plugin)</h3>
<p>อันนี้อาจจะไม่เชิง sync ซะทีเดียว แต่เรายังสามารถใช้เผื่อ backup vault ของเราได้อีกด้วย เพราะ Git ก็คือ version control system ตัวนึงที่ทำให้เราสามารถติดตามการเปลี่ยนแปลงของไฟล์เราได้ การใช้งาน plugin นี้ก็เหมือนวิธีก่อนหน้าเลยครับ เข้าไปติดตั้ง plugin <code>Obsidian Git</code> แล้วก็ทำการ enable กับ config ให้เรียบร้อยก็จะใช้งานได้ทันทีครับ ซึ่ง plugin ตัวนี้สามารถตั้งค่าได้ครอบคลุมการใช้งานที่หลากหลายมากๆ เช่นให้ backup แล้ว push ไปที่ remote repository ของเรา ในทุกๆเสลาที่เรากำหนดหรือทุกครั้งที่เราเปิดโปรแกรมขึ้นมา หรือคอย pull ดูอยู่เรื่อยๆว่ามีอัพเดตอะไรมาใหม่หรือไม่ แต่เนื่องด้วยความที่ Git เป็นความรู้เฉพาะทาง ทำให้การตั้งค่าในโทรศัพท์มือถือก็มีขั้นตอนที่เพิ่มขึ้นมาไม่น้อยเช่นกัน การขาดความเข้าใจอาจจะทำให้ข้อมูลหลุดหรือสูญหายได้เลยทีเดียว ฉะนั้นหากคุณไม่ได้เข้าใจว่า Git คืออะไรก็ขอให้ข้ามมันไปก่อนล่ะกันครับ</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703237648670/c6246413-254b-4677-ba0f-712d2ff8ebbe.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-4-syncthing">4/ Syncthing</h3>
<p>เข้าสู่ดาวเด่นของงานในวันนี้ ซึ่งเป็นวิธีที่ผมชอบมากที่สุดเลยก็ว่าได้ เพราะเจ้าตัว Syncthing มันทำงานแบบ real-time ทำให้เมื่อเราแก้ไฟล์ที่ laptop ของเรา โทรศัพท์ก็จะเห็นการเปลี่ยนแปลงนั้นแบบไวมากๆ เรียกว่ามีข้อดีเต็มไปหมด แต่ก็ใช่ว่าจะไม่มีข้อเสีย ข้อเสียหลักๆของ Syncthing นั่นก็คือการที่ตัวมันเป็นอีกโปรแกรมนึงเลยที่เราต้องดูแลและตั้งค่ามัน เพราะแท้จริงแล้ว Syncthing เป็นเพียงโปรแกรมที่เอาไป sync ไฟล์ระหว่างสองเครื่อง ไม่ได้มีส่วนเกี่ยวข้องอะไรกับ Obsidian แต่อย่างใด ซึ่งในการใช้งานเราจะต้องทำการเพิ่ม remote devices ให้อุปกรณ์ของเรารู้จักกันเสียก่อน หลังจากนั้นเราจึงสามารถ share folder ของเราไปให้อุปกรณ์อื่นได้ และข้อมูลระหว่างสองอุปกรณ์ก็จะ sync กันอยู่เสมอตราบเท่าที่โปรแกรม Syncthing ยังคงทำงานอยู่ครับ และการใช้งานโปรแกรมนี้ก็ควรระมัดระวังเรื่องของการตั้งค่าให้ดีเพราะค่อนข้างเฉพาะทางมากๆครับ</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703238456870/33accf35-76c5-4dd2-b906-e36c88042add.png" alt class="image--center mx-auto" /></p>
<p>หากคุณสนใจก็ลองอ่านเรื่อง<a target="_blank" href="https://docs.syncthing.net/users/security.html">ความปลอดภัย</a>ของเจ้าโปรแกรมตัวนี้ดูก่อนได้ แล้วก็ค่อยๆอ่าน document ในส่วนที่เราสงสัยตามไปเรื่อยๆครับ เมื่อเข้าใจพื้นฐานของมัน โปรแกรมนี้ก็เป็นอีกเครื่องมือที่ประยุกต์ใช้ในสถานการณ์อื่นๆได้ดีเช่นกันครับ</p>
<h2 id="heading-4liq4lij4li44lib">สรุป</h2>
<p>หลังจากที่เราเต็มอิ่มกับวิธีทั้งหมดที่มีกันไปแล้ว หากเพื่อนๆมีวิธีอื่นที่น่าสนใจก็ comment บอกกันได้เลยครับ ซึ่งจากที่เราเห็นบางวิธีก็ง่าย แต่ก็อาจจะไม่ได้ตามที่เราต้องการ หรือบางวิธีที่ดูจะได้ตามสิ่งที่เราต้องการก็ดูยากเย็นเหลือเกินกว่าจะได้มันมา ถ้าทำไม่ดี หรือทำอะไรผิดไปบางขั้นตอนก็อาจเป็นเหตุให้ข้อมูลสูญหายกันได้อีกด้วย ฉะนั้นการจ่างเงินในบางครั้งก็ดูเป็นทางออกที่ไม่เลวครับ 😅</p>
<p>ถ้าคุณชอบบทความแบบนี้ อย่าลืมกดติดตาม เพื่อรับการแจ้งเตือนบทความถัดไปด้วยนะครับ 🙇🏻‍♂️</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703238009009/4845769a-35ad-4ff7-b8a1-88dcaf09bbc1.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-references">References</h2>
<ul>
<li><a target="_blank" href="https://help.obsidian.md/Getting+started/Sync+your+notes+across+devices">https://help.obsidian.md/Getting+started/Sync+your+notes+across+devices</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Do the Fun Chaos Engineering with Gamification!]]></title><description><![CDATA[Is Chaos Engineering fun? Nani!!]]></description><link>https://blog.pepo.dev/do-the-fun-chaos-engineering-with-gamification</link><guid isPermaLink="true">https://blog.pepo.dev/do-the-fun-chaos-engineering-with-gamification</guid><category><![CDATA[game]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[gamification ]]></category><category><![CDATA[Chaos Engineering]]></category><dc:creator><![CDATA[Thiwanon Chomcharoen]]></dc:creator><pubDate>Mon, 13 Mar 2023 14:24:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1651863348760/tEoT2O2Ce.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><em>disclaimer: This post focuses on how fun chaos engineering can be. This does not cover the principal and real practicalities of chaos engineering.</em></p>
</blockquote>
<h2 id="heading-what-is-chaos-engineering">What is Chaos Engineering?</h2>
<blockquote>
<p>Chaos engineering is the process of testing a distributed computing system to ensure that it can withstand unexpected disruptions. It relies on concepts underlying chaos theory, which focuses on random and unpredictable behavior.</p>
<p><a target="_blank" href="https://www.techtarget.com/searchitoperations/definition/chaos-engineering">TechTarget</a></p>
</blockquote>
<p>The meaning is relatively straightforward, In short, It's is "rude to your cluster and hope it can survive". But the real world of Chaos Engineering has a lot of topics for measuring the metrics that you can ensure your experiment runs successfully or not.</p>
<p>Leave it behind, Because in this article we will talk only about the <strong>FUN</strong> part of chaos engineering, But it might not be fun for everyone 🤣</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651862659687/3nVA2mppF.png" alt="Meme" /></p>
<h2 id="heading-what-is-gamification">What is Gamification?</h2>
<blockquote>
<p>The practice of making <strong>activities</strong> more like <strong>games</strong> in order to make them more interesting or <strong>enjoyable.</strong></p>
<p><a target="_blank" href="https://dictionary.cambridge.org/dictionary/english/gamification">Cambridge Dictionary</a></p>
</blockquote>
<p>For example, In the classroom, the teacher can give you a point that you can use to exchange with a special score or some benefits like gaining more time to do the homework than other people and the point will give to the student that participated and answers in the classroom. Does it sound like the game?</p>
<p><img src="https://media-exp1.licdn.com/dms/image/D5612AQFQPecMWpxmnQ/article-cover_image-shrink_600_2000/0/1663035818162?e=2147483647&amp;v=beta&amp;t=WRHL7nWKj6B_0YzTn7KDBQff9GN_xvcnvvJrWs8VKCk" alt="Sirish Puppala on LinkedIn: Building Next-Gen Technology: How SS&amp;C Eze  Fosters Innovation" /></p>
<h2 id="heading-ready-for-the-fun">Ready for the fun?</h2>
<p>The formula is -&gt; <code>Chaos engineering + Gamification = Fun (Maybe)!</code></p>
<p>To make it fun, We need to make the process more like a game. That you can play a game while doing the chaos engineering at the same time.</p>
<p>A lot of the interesting projects to make chaos engineering more fun has created on GitHub, Thanks for the open sources.</p>
<p>Are you ready? Let's get started.</p>
<blockquote>
<p>⚠️ Warning: Do with your own risk!</p>
</blockquote>
<h3 id="heading-1-kube-doom">1. Kube Doom</h3>
<blockquote>
<p>KubeDoom is The next level of chaos engineering! Kill pods inside your Kubernetes cluster by shooting them in Doom! - <a target="_blank" href="https://github.com/storax/kubedoom">KubeDoom</a></p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651863348760/tEoT2O2Ce.png" alt="KubeDoom" /></p>
<h3 id="heading-2-kubeinvaders">2. KubeInvaders</h3>
<blockquote>
<p>Gamified Chaos Engineering Tool for Kubernetes - <a target="_blank" href="https://github.com/lucky-sideburn/KubeInvaders">KubeInvaders</a></p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1683888130697/8ae6b234-4f89-4e60-9d19-49f44672d9c0.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-3-kube-chaos">3. Kube Chaos</h3>
<blockquote>
<p>A chaos engineering style game where you seek out and destroy Kubernetes pods, twinstick shmup style - <a target="_blank" href="https://github.com/Shogan/kube-chaos">Kube Chaos</a></p>
</blockquote>
<iframe width="840" height="470" src="https://user-images.githubusercontent.com/814180/119267327-07a41c80-bbe6-11eb-87ec-25ee0f96e669.mp4"></iframe>

<h2 id="heading-summary">Summary</h2>
<p>These are the example projects that I found to make chaos engineering fun. If you find more interesting projects please tell me. But also please note that this is not the real principle of chaos engineering. It's just fun to implement the game with some chaos engineering concepts. To make it right, You need to understand more in the context of what you are doing and experiment for the result that you are looking for to improve the durability of your system.</p>
<p>Have fun! and see you in the next post.</p>
]]></content:encoded></item><item><title><![CDATA[AWS Local Zone Bangkok Launch]]></title><description><![CDATA[Local zone คืออะไรและเมื่อไหร่ถึงควรใช้กันนะ?]]></description><link>https://blog.pepo.dev/aws-local-zone-bangkok-launch</link><guid isPermaLink="true">https://blog.pepo.dev/aws-local-zone-bangkok-launch</guid><category><![CDATA[Cloud]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Cloud Computing]]></category><dc:creator><![CDATA[Thiwanon Chomcharoen]]></dc:creator><pubDate>Mon, 13 Mar 2023 14:22:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676303064089/130dd7b7-8617-40a4-8334-0e406a19f70d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>พอดีได้มีโอกาสไปร่วมงานเปิดตัว AWS Bangkok Local zone ที่โรงแรม Anantara Siam Bangkok Hotel เมื่อวันที่ 31 มกราที่ผ่านมา เลยลองสรุปสาระสำคัญจากงานมาฝากครับ</p>
<h2 id="heading-local-zone">ทำไมต้อง Local Zone?</h2>
<p>เกริ่นก่อนสำหรับคนที่ยังไม่เข้าใจ Local zone มากนัก เอาง่ายๆเลย มันก็คือโซนท้องถิ่นนั่นเอง! อย่าเพิ่งเอ๊ะไป เราลองเข้าไปดูใน <a target="_blank" href="https://aws.amazon.com/about-aws/global-infrastructure/">AWS Global Infrastructure</a> ได้บอกไว้ว่า Region ประกอบไปด้วย Avaliability zone ซึ่งบ่อยครั้งก็อยู่ห่างจาก User มากเกินไป จึงทำให้เกิด Local Zone ที่มีคุณลักษณะคล้าย Availibility Zone หลายประการ แต่เข้าไปอยู่ใกล้ User มากขึ้นเพื่อรองรับการทำงานที่ต้องการ latency ต่ำนั่นเอง ซึ่ง Bangkok Local Zone ก็ถือเป็น Zone ภายใต้ <code>ap-southeast-1</code> หรือ Singapore (อนาคตก็จะไม่ได้อยู่ใน Thailand region นะ)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676295651398/157f2d83-ab6e-4ca5-a9cb-7d8fb2bb6b5c.jpeg" alt="หน้าตา architecture ของ AWS Local Zone" /></p>
<h2 id="heading-latency">Latency ที่ตอบโจทย์</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676262051125/2849788e-42c5-4dfc-b830-213c800ff21d.jpeg" alt="การทดสอบที่ลองสั่ง ping ไปยังเครื่องใน ap-southeast-1 (รูปซ้าย) กับฝั่ง local zone (รูปขวา)" /></p>
<p>จากรูปของการทดสอบที่ลองสั่ง <code>ping</code> ไปยังเครื่องใน <code>ap-southeast-1</code> (รูปซ้าย) ที่ใช้เวลาประมาณ 27ms กับฝั่ง local zone (รูปขวา) ประมาณ 4ms จะเห็นได้ว่า local zone ให้ latency ที่ต่ำกว่าประมาณ 6 เท่าเลยทีเดียว!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676294313357/51a917b8-1e73-4d2a-a34d-717779c2bea3.png" alt /></p>
<p>และเนื่องจาก Bangkok Local zone จะอยู่ภายใต้ Region Singapore จึงใช้ Network backbone เดียวกัน ทำให้เราสามารถติดต่อกับ Service ที่มีตามเดิมใน region ได้ปกติ ไม่ได้วิ่งออก public network แต่อย่างใด</p>
<h2 id="heading-services">Services ที่รองรับ</h2>
<p>ณ ปัจจุบัน Services ที่พร้อมให้บริการบน Local Zone (วงกลมส้ม) จะยังมีไม่มากแต่ทาง AWS ก็มีแพลนจะเพิ่ม Services ที่สามารถใช้งานบน Local zone ขึ้นอีกในอนาคต (วงกลมขาว)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676295451367/a82a4627-30e0-4cc9-8588-a12e26630c17.png" alt /></p>
<p>และถึงแม้ว่า services จะยังไม่มากนัก แต่ก็ค่อนข้างเพียงพอต่อความต้องการในการยกระดับ system ที่มี latency sensitive ให้มี performance ที่มากขึ้นได้ และนอกจาก Services ในข้างต้น เรายังสามารถใช้ AWS Marketplace Partner ภายใน Local zone ได้เหมือน region ปกติอีกด้วย</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676295145979/aca2990b-41c4-49f0-b01a-428d2b5da242.jpeg" alt /></p>
<h2 id="heading-4lij4liy4lie4liy4lma4lix4lmi4liy4lme4lir4lij4lmi4lib4lix4liz4liz4liw">ราคาเท่าไหร่กันนะ</h2>
<p>พูดกันมาถึงขนาดนี้ หลายๆท่านคงเตรียมเปิด console ไปกดสร้างหรือเตรียมแผนงานย้ายระบบมาอยู่บน Local zone กันเป็นแน่แท้ แต่ก่อนจะไปขั้นนั้น ลองมาดูค่าใช้จ่ายเมื่อเทียบกับ compute ทั่วไปบน region กันก่อน</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td></td><td>EC2 (Region)</td><td>EC2 (Local Zone)</td></tr>
</thead>
<tbody>
<tr>
<td>Instance (c5.2xlarge) / hours</td><td>$0.392</td><td>$0.549</td></tr>
<tr>
<td>EBS (gp2) / GB</td><td>$0.12</td><td>$0.246</td></tr>
</tbody>
</table>
</div><p>จะเห็นได้ว่าราคาของ compute บน local zone สูงกว่าบน region ประมาณ 40% เลยทีเดียว นอกจากนี้เรายังเสียค่า Network Transfer ทั้ง In และ Out $0.08/GB อีกด้วย (<a target="_blank" href="https://aws.amazon.com/th/about-aws/global-infrastructure/localzones/pricing/">ดูราคาเพิ่มเติม</a>) นอกจากราคาที่เพิ่มขึ้นแล้วยังมี Instance Type และ Disk Type ให้เลือกค่อนข้างจำกัด ฉะนั้น เราจะมาพูดคุยถึง Use case ของการนำ Local zone มาใช้ให้เกิดความคุ้มค่าในด้านไหนได้บ้าง ช่วงท้ายของบทความ</p>
<h2 id="heading-thailand-region">การมาของ Thailand Region</h2>
<p>ยังไม่หมดเพียงเท่านั้น ภายในงานยังมีการพูดถึงการมาในอนาคตของ Thailand Region เพราะ AWS ถึงกับทุ่มเงินจำนวน 190 ล้านบาท เพื่อเข้ามาทำ Region ในประเทศไทยกันเลยทีเดียว</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676294142398/f8cda37d-5dcb-4514-8bff-ff16f2085ae5.jpeg" alt /></p>
<p>และภายในงานยังมีคำถามที่น่าสนใจดังนี้</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676294217769/9341e5a5-74d6-4c04-8786-fdd1165b50c8.jpeg" alt /></p>
<p>กล่าวโดยสรุปคือ BKK Local zone จะเป็นส่วนต่อขยายของ Singapore และจะไม่มีอะไรเกี่ยวข้องกับ TH Region ในอนาคต ถึงแม้ว่า TH Region จะเสร็จและพร้อมใช้งาน ก็จะไม่มีการย้าย BKK Local Zone มาที่ TH region แต่อย่างใด</p>
<h2 id="heading-4lmd4lik4lmj4lmd4lir4lmj4liw4li54lib4lih4liy4liz">ใช้ให้ถูกงาน</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676294469525/8d0d66b6-384b-4b56-aea4-dac7a8b30cef.jpeg" alt /></p>
<p>ลองมาดูตัวอย่างหรือ Use case การนำ Local zone มาใช้เพื่อให้เกิดประโยชน์กันดีกว่า</p>
<ul>
<li><p><strong>Game</strong></p>
<ul>
<li>ตัวอย่างจากค่ายเกม Supercell เจ้าของเกมยอดนิยมอย่าง Clash of Clans ที่ต้องการให้บริการ Game Server ให้ผู้เล่นมี latency ที่ต่ำเพื่อให้ได้รับประสบการณ์การเล่นเกมที่ดีมากยิ่งขึ้น</li>
</ul>
</li>
<li><p><strong>Content creation</strong></p>
<ul>
<li>อันนี้ยกตัวอย่างถึงบริษัท Netflix ที่มีการเอา Local zone ไปให้บริการสำหรับ service ที่ run latency sensitive เช่นการ live production video editing ให้ใกล้กับเหล่า artist มากยิ่งขึ้น</li>
</ul>
</li>
<li><p><strong>Remote broadcasting</strong></p>
<ul>
<li>Esports Engine สามารถพัฒนาระบบที่มี latency ต่ำและมี performance ที่ดีขึ้นสำหรับการ broadcasting video ด้วยการวาง AWS Local zone ให้ใกล้กับผู้ใช้งาน พร้อมทั้งสามารถ scale ไปสู่ Global ได้ทันทีอีกด้วย</li>
</ul>
</li>
</ul>
<h2 id="heading-4liq4lij4li44libipcfl5lvui8">สรุป 🗒️</h2>
<p>สำหรับองค์กรที่คิดจะกระโดดเข้ามาสู่การใช้ Bangkok Local zone จะต้องมี Use case ที่เหมาะสม เพราะนอกจากจะมีราคาที่มากกว่าเดิมแล้ว Service หลายๆตัวก็ยังไม่พร้อมให้บริการ ณ ขณะที่เขียนบทความนี้ แต่ก็ถือว่าเป็นสิ่งที่น่าสนใจมาก ที่จะนำมาช่วยพัฒนาระบบที่ต้องการ latency ที่ต่ำเพื่อให้ได้ performance ที่มากขึ้น ใครต้องการจะทดสอบก็สามารถลองทำตาม<a target="_blank" href="https://aws.amazon.com/th/blogs/thailand/aws-local-zones-bangkok-%E0%B8%9E%E0%B8%A3%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B8%9A%E0%B8%A3%E0%B8%B4%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%A5%E0%B9%89%E0%B8%A7/">บทความ</a>จาก AWS ได้เลย</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676295317035/b4aa9309-8bbc-45d4-b95d-f304623c1b1c.jpeg" alt class="image--center mx-auto" /></p>
<p>ถ้าชอบก็อย่าลืมกดติดตามบทความถัดๆไปด้วยนะ ขอบคุณครับ 🙇🏻‍♂️</p>
]]></content:encoded></item></channel></rss>