Self Hosting Web Stacks on Bare Metal
Two years ago, our agency hit a wall on a Tuesday morning. One retail client sent a seasonal newsletter to 90,000 subscribers, pushing 3,400 concurrent sessions onto their WooCommerce storefront. Within four minutes, uncached Time to First Byte jumped to 2.9 seconds, checkout callbacks timed out, and PHP workers sat pinned at the plan ceiling. Support responded forty minutes later with a sales pitch: upgrade that single site to the next tier for an extra $450 a month.
That wasn't a freak event. Across our 14 active client CMS properties—eight WordPress sites, four Craft CMS builds, and two Drupal 10 portals serving roughly 19 million monthly pageviews—we were paying premium rates for throttled containers and sluggish network storage. Modern cloud computing promised effortless elasticity, yet our invoices told a different story. Between managed agency tiers, AWS EC2 nodes, Multi-AZ RDS, and metered NAT gateways, we were burning $3,840 every single month.
Six weeks later, all 14 sites were running on two leased NVMe bare-metal servers. Direct infrastructure costs dropped by 85 percent, tail latency collapsed, and we haven't looked back. Here is the exact monthly ledger, production latency data, and the maintenance tradeoffs people conveniently leave out when bragging about leaving the cloud.
The Monthly Math: $3,840 Down to $575 (Plus Honest Ops Time)
Too many "we left the cloud" write-ups hide half the real cost by ignoring CDN bills, off-site backups, or engineering hours. Here is every line item from our old billing sheet compared against what we pay today.
Before migrating, our 14 client sites cost $3,840/month ($46,080/year):
- 8 WordPress sites on managed agency hosting (base tier, staging slots, bandwidth overages): $1,420/month
- 4 Craft CMS builds on managed PaaS containers with dedicated database and Redis add-ons: $1,180/month
- 2 Drupal 10 portals on AWS (two
c6i.largeweb nodes, Multi-AZdb.m6g.largeRDS, EFS, ALB, NAT Gateway, egress): $1,240/month
We replaced all of it with two identical bare-metal servers (bm-01 and bm-02) in separate racks with independent power feeds. Each box runs an AMD Ryzen 9 7950X (16 cores, 32 threads), 128 GB DDR5 ECC RAM, dual 3.84 TB enterprise Gen4 NVMe drives in software RAID-1, an unmetered 1 Gbps public uplink, and a 10 Gbps private VLAN interconnect.
Our full bare-metal bill totals $575/month ($6,900/year):
- Two Ryzen 9 7950X NVMe bare-metal servers at $219/month each: $438/month
- Off-site encrypted backups (1.8 TB across Restic snapshots and WAL/binlog archives on S3-compatible object storage): $34/month
- Edge CDN, WAF, and DNS across 14 domains (paid tiers on our three e-commerce stores, standard proxy on the rest): $85/month
- External monitoring box in a separate region running Prometheus, Alertmanager, and synthetic HTTP checks: $18/month
On raw infrastructure, that saves $3,265/month ($39,180/year). Now add real labor, because Linux boxes don't maintain themselves. Upfront Ansible playbooks, Debian 12 hardening, replication setup, and staged cutovers took 48 engineering hours. Ongoing maintenance—patch review, monthly rolling reboots, NVMe health checks, and backup restore drills—takes 6 to 8 hours per month. At an internal blended rate of $125/hour, budget $1,000/month worst case. Even with labor included, our all-in cost sits at $1,575/month against $3,840/month before, returning $2,265/month ($27,180/year) to agency margin.
Why Steal=0 and Local NVMe Transform PHP Latency
PHP-based CMS stacks suffer badly under noisy virtualization. Each uncached WordPress or Craft request runs synchronously on a single thread, executing dozens of quick SQL queries and filesystem stat calls before flushing HTML. On a multi-tenant virtual private server or burstable cloud tier, hypervisor scheduling queues and L3 cache eviction from neighboring workloads inject erratic pauses straight into response times.
During peak afternoon traffic on our old cloud nodes, mpstat routinely showed 8 to 14 percent CPU steal. Bare metal removes the hypervisor completely. Here is a snapshot from bm-01 during a live promotional surge of 2,900 concurrent sessions:
$ mpstat -P ALL 1 2
Linux 6.1.0-26-amd64 (bm-01) 10/14/2026 _x86_64_ (32 CPU)
14:12:01 CPU %usr %nice %sys %iowait %irq %soft %steal %idle
14:12:02 all 21.40 0.00 3.85 0.11 0.00 0.64 0.00 74.00
14:12:03 all 22.15 0.00 3.92 0.09 0.00 0.71 0.00 73.13
Pairing %steal at 0.00 with 5.4 GHz single-core Ryzen boost clocks reshaped latency immediately. Across 30 days of synthetic checks hitting uncached dynamic routes (carts, search, logged-in dashboards) across all 14 sites:
- p50 TTFB dropped from 410 ms to 88 ms
- p95 TTFB dropped from 1,380 ms to 195 ms
- p99 TTFB dropped from 3,120 ms to 310 ms
Local Gen4 NVMe drives did just as much work as the CPU. On gp3 EBS volumes at 3,000 baseline IOPS, fio clocked 4K random write fsync latency around 0.92 ms, jumping past 4 ms during checkpoints. Local RAID-1 NVMe hit 94,000 random read IOPS and 0.07 ms commit latency. All 14 databases total 68 GB on disk, fitting comfortably inside each server's 128 GB of RAM so hot pages stay cached in memory.
We consolidated Craft and Drupal onto PostgreSQL 16 while keeping WordPress on MariaDB 10.11, following the workload tradeoffs from our benchmark of PostgreSQL vs MariaDB for modern CMS stacks. Fast disks can mask sloppy SQL until a table crosses half a million rows, though—we still had to fix unindexed joins using the workflow from our piece on database indexing for slow CMS views.
Boring Isolation: Two Debian Nodes, Zero Kubernetes
Peers often ask which Kubernetes distribution we chose for two bare-metal boxes. None. Running etcd, a control plane, and CNI overlays across two machines multiplies failure modes without helping PHP.
Instead, we run plain Debian 12 configured via Ansible. Nginx handles TLS, HTTP/3, and per-site FastCGI microcaching. Each client gets an isolated Linux user, dedicated PHP-FPM socket, separate database role, and systemd cgroup limits so one buggy plugin can't OOM-kill neighboring stores:
# /etc/systemd/system/client-acme-fpm.service.d/limits.conf
[Service]
CPUQuota=400%
MemoryHigh=3G
MemoryMax=4G
TasksMax=128
ProtectSystem=strict
ReadWritePaths=/srv/www/acme/shared /run/php-fpm
Pool sizing mattered more than any other tweak. Managed hosts starve sites at four or six workers to push upgrades. With 32 threads and 128 GB of RAM, we measured average worker RSS per app (68 to 85 MB under OPcache) and dialed in pool caps using a disciplined approach to sizing PHP workers for bare-metal VPS nodes. Our three e-commerce sites run 24 static workers each; quiet brochure sites cap out at 6 on-demand workers.
Both nodes serve HTTP active-active behind health-checked edge origins. A private WireGuard mesh handles continuous database replication from bm-01 to bm-02 at sub-millisecond lag, while client media uploads go directly to S3-compatible object storage so local disks stay free of unbacked files. Releases roll out atomically across both servers using the symlink and upstream-drain pattern from our playbook on blue-green CMS deployments done right.
The Honest Maintenance Tradeoffs
Bare metal is rewarding, yet anyone claiming it requires zero sweat isn't running production workloads. Four realities earned permanent space in our ops runbook over the last 18 months:
Hardware fails on its own schedule
Seven months in, smartd paged me at 6:20 AM when /dev/nvme1n1 on bm-01 started logging media integrity errors. Software RAID-1 kept every site online without dropping a request, and datacenter technicians swapped the drive inside four hours. Still, I was the one checking /proc/mdstat before coffee and watching the rebuild finish.
Kernel reboots and restore drills are non-negotiable
Unattended security updates patch userland packages, yet major kernel advisories still require rolling reboots. Once a month we drain bm-02 from the edge pool, patch and reboot it, promote its database replica to primary, and repeat on bm-01. That takes 45 quiet minutes because we scripted and rehearsed it. Likewise, Restic pushes encrypted off-site backups every six hours, and a monthly cron job restores a random client archive onto a scratch VM to verify real recoverability. Twice in 18 months, that test caught permission drift before an outage could.
A 1 Gbps port won't absorb a volumetric DDoS
Bare metal delivers huge application throughput, not infinite edge bandwidth. Keeping a WAF proxy in front of both boxes—and configuring nftables to drop all port 80 and 443 traffic outside the edge network's published CIDR blocks—is mandatory.
You don't eliminate complexity by leaving managed cloud tiers. You trade unpredictable invoices and noisy neighbors for explicit, deterministic ownership of your own Linux stack.
Where the Break-Even Line Actually Sits
Bare metal isn't right for every shop. If you run three low-traffic brochure sites, have nobody comfortable reading journalctl or diagnosing a stalled replication slot, or need a hosting vendor to hand you a signed HIPAA BAA tomorrow, stay on managed hosting. Paying $400/month to avoid Linux operations is a great deal.
The numbers flip once your managed tiers and cloud databases clear $1,800 to $2,000/month, especially when arbitrary PHP worker limits or CPU steal start hurting client revenue. If at least two engineers on your team can maintain Ansible playbooks, verify restores, and run a calm database failover, two NVMe bare-metal servers will cut hosting overhead in half while delivering the lowest TTFB your clients have ever seen. Eighteen months in, our pair of Ryzen boxes has been fast, cheap, and completely boring—and in web operations, boring is the highest praise hardware can earn.
Comments
Post a Comment