<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shota M. | Air-Gapped HPC Arch</title>
    <description>The latest articles on DEV Community by Shota M. | Air-Gapped HPC Arch (@shotamatsubara).</description>
    <link>https://dev.to/shotamatsubara</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4134041%2F53afaabb-1efa-449c-be09-97293a0ebea8.jpg</url>
      <title>DEV Community: Shota M. | Air-Gapped HPC Arch</title>
      <link>https://dev.to/shotamatsubara</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shotamatsubara"/>
    <language>en</language>
    <item>
      <title>10M Batch LLM Inference at $0 Cloud Cost: O(1) Memory Clamped Architecture</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Thu, 08 Oct 2026 14:13:31 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/10m-batch-llm-inference-at-0-cloud-cost-o1-memory-clamped-architecture-1g62</link>
      <guid>https://dev.to/shotamatsubara/10m-batch-llm-inference-at-0-cloud-cost-o1-memory-clamped-architecture-1g62</guid>
      <description>&lt;p&gt;High cloud API costs and Out-Of-Memory (OOM) failures in large-scale data pipelines are architectural defects, not hardware constraints.&lt;/p&gt;

&lt;p&gt;This report documents the performance of a 10,000,000-record batch LLM inference workload executed locally on an HP Z4 G4 workstation (Intel Xeon W-2155, 128GB ECC DDR4 RAM, NVIDIA RTX 5060 Ti 16GB VRAM, NVMe PCIe Gen4 SSD).&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified Metrics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Success Rate&lt;/strong&gt;: 100.00% (10,000,000 / 10,000,000 records, 0.00% error rate)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Average Throughput&lt;/strong&gt;: ~254.9 req/s&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Runtime&lt;/strong&gt;: 10.9 hours&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Bounds&lt;/strong&gt;: Clamped between 6.72GiB and 9.4GB RAM (O(1) constant space)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database State&lt;/strong&gt;: 3.4GB SQLite WAL (&lt;code&gt;PRAGMA integrity_check: ok&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute Cost&lt;/strong&gt;: $0.00&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Memory Allocator Substitution (jemalloc)
&lt;/h3&gt;

&lt;p&gt;glibc malloc exhibits heap fragmentation under sustained allocation and deallocation cycles. Injecting &lt;code&gt;libjemalloc2&lt;/code&gt; via &lt;code&gt;LD_PRELOAD&lt;/code&gt; with active background thread decay (&lt;code&gt;MALLOC_CONF="background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:2000"&lt;/code&gt;) prevents process RSS growth and maintains a predictable host RAM footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Disk-Backed Parquet Streaming (Polars)
&lt;/h3&gt;

&lt;p&gt;In-memory array construction introduces O(N) spatial memory complexity. Streaming chunked outputs directly to disk using Polars (&lt;code&gt;collect(engine="streaming")&lt;/code&gt; and &lt;code&gt;sink_parquet&lt;/code&gt;) ensures memory usage remains independent of row count.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Atomic 2-Phase Transaction Logging (aiosqlite + WAL)
&lt;/h3&gt;

&lt;p&gt;State recovery and record tracking are managed via an &lt;code&gt;aiosqlite&lt;/code&gt; pipeline using Write-Ahead Logging (&lt;code&gt;PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;&lt;/code&gt;). Explicit &lt;code&gt;BEGIN IMMEDIATE&lt;/code&gt; transaction blocks are executed every 50,000 items, with periodic WAL truncation to guarantee system crash consistency and database integrity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero Telemetry &amp;amp; Regulatory Compliance
&lt;/h2&gt;

&lt;p&gt;Transmitting unmasked enterprise datasets to external APIs introduces regulatory compliance risks under HIPAA and GDPR. Executing high-throughput LLM workloads on local, air-gapped infrastructure (&lt;code&gt;--network none&lt;/code&gt;) prevents telemetry transmission and external data exposure.&lt;/p&gt;

&lt;p&gt;Reproducible Code &amp;amp; Repository:&lt;br&gt;
&lt;a href="https://github.com/Matsubara-CEO" rel="noopener noreferrer"&gt;https://github.com/Matsubara-CEO&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Defeating AWS OOM and Cloud Costs: A Zero-Cloud-Cost Architecture using 128GB Bare-Metal, Polars, and jemalloc</title>
      <dc:creator>Shota M. | Air-Gapped HPC Arch</dc:creator>
      <pubDate>Sun, 20 Sep 2026 11:56:40 +0000</pubDate>
      <link>https://dev.to/shotamatsubara/defeating-aws-oom-and-cloud-costs-a-zero-cloud-cost-architecture-using-128gb-bare-metal-polars-1a3a</link>
      <guid>https://dev.to/shotamatsubara/defeating-aws-oom-and-cloud-costs-a-zero-cloud-cost-architecture-using-128gb-bare-metal-polars-1a3a</guid>
      <description>&lt;p&gt;Enterprises continuously burn thousands of dollars on AWS high-memory instances (e.g., r5.4xlarge) to avoid Out-Of-Memory (OOM) crashes when processing massive datasets or running local LLM inferences. Scaling vertically in the cloud is a costly workaround for inefficient memory architecture.&lt;/p&gt;

&lt;p&gt;We engineered a Zero-Cloud-Cost, fully Air-Gapped data infrastructure that fundamentally eradicates OOM errors by locking the memory footprint to a constant O(1) space.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hardware &amp;amp; Tech Stack
&lt;/h2&gt;

&lt;p&gt;The baseline is a bare-metal HPC fortress: an HP Z4 G4 Workstation equipped with an Intel Xeon W-2155 (10C/20T), 128GB ECC RAM, and an RTX 5060 Ti 16GB.&lt;/p&gt;

&lt;p&gt;Rather than relying on pandas (which loads entire datasets into RAM and causes alignment cliffs), we utilized Polars LazyFrames and out-of-core streaming. State management was completely migrated from in-memory accumulation to an SQLite WAL (Write-Ahead Logging) database, utilizing atomic 2-phase commits per 50,000-row chunk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Eradicating the OOM Killer with jemalloc
&lt;/h2&gt;

&lt;p&gt;Python and glibc's memory allocator notoriously delay memory returns, leading to severe fragmentation and inevitable SIGKILL terminations in containerized environments. We bypassed this entirely by hard-injecting &lt;code&gt;libjemalloc2&lt;/code&gt; into the Docker container.&lt;/p&gt;

&lt;p&gt;By injecting &lt;code&gt;LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2&lt;/code&gt; and aggressively tuning &lt;code&gt;_RJEM_MALLOC_CONF="background_thread:true,dirty_decay_ms:0,muzzy_decay_ms:0"&lt;/code&gt;, we forced immediate background memory reclamation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deterministic Evidence
&lt;/h2&gt;

&lt;p&gt;The results are deterministic and reproducible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Throughput &amp;amp; Memory Footprint&lt;/strong&gt;: Processed 10M+ rows while the host RAM remained strictly locked between 7GB and 9GB maximum (O(1) constant space) despite processing massive continuous datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Costs &amp;amp; Egress&lt;/strong&gt;: $0.00.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: 100% offline (launched with &lt;code&gt;--network none&lt;/code&gt;), mathematically guaranteeing zero PHI/PII data leakage for absolute HIPAA/GDPR compliance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cloud scalability is not a panacea for poor data engineering. On-premise, air-gapped HPC provides deterministic performance, absolute data privacy, and zero recurring compute costs.&lt;/p&gt;

&lt;p&gt;Need a HIPAA/GDPR-compliant, Zero-Cloud-Cost infrastructure deployed directly to your bare-metal environment? &lt;br&gt;
I do not ask for your sensitive data; I deliver the air-gapped architecture so you can process it securely yourself.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Hire me on Upwork for Fixed-Price enterprise consulting&lt;/strong&gt;: &lt;br&gt;
&lt;a href="https://www.upwork.com/freelancers/shotamatsubara" rel="noopener noreferrer"&gt;https://www.upwork.com/freelancers/shotamatsubara&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Connect with me on LinkedIn&lt;/strong&gt;: &lt;br&gt;
&lt;a href="https://www.linkedin.com/in/shota-matsubara-hpc/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/shota-matsubara-hpc/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>aws</category>
      <category>python</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
