Disposable Ubuntu 24.04 servers in Docker that behave like fresh VPSes — systemd as PID 1, sshd, sudo, cron, and journald with static private IPs — for deploying and testing DevOps/SRE automation over SSH without renting machines.

Saurav Singh Karmwar
Site Reliability Engineer
I run a self-hosted Temporal platform and the PostgreSQL fleet behind it. I like finding the real cause of an incident, fixing it so it stays fixed, and writing it down.
Projects
All projectsMulti-tenant SaaS control plane where every tenant lifecycle operation — provision, upgrade, migrate, backup, restore, delete — runs as a durable Temporal workflow with saga compensation and a retryable DLQ.
Active-passive HA lab with nginx, keepalived (VRRP), a Go backend, and a full observability stack (Prometheus, Grafana, Loki, Alertmanager) — single-command Docker Compose deploy with an automated failover test suite.
A self-contained Linux patch governance platform — Aptly mirror/snapshot promotion, a custom-built AWX standalone install orchestrating everything on a schedule, and Grafana dashboards backed by a Postgres governance DB.
Experience
- Took workflow scheduling latency from seconds to milliseconds, and a core flow to under a second at higher load, by re-sharding the multi-node Temporal cluster with a near-instant cutover and fixing the rate limits and Go memory settings that were starving it.
- Ended a memory and load leak in the automation worker: every script ran through exec() in a shell and was orphaned on timeout or restart. Replaced it with spawn in its own process group, a hard kill-after deadline, and group kill on cancel and shutdown.
- Built tenctl, an internal CLI that runs Node workers as systemd services instead of PM2, with per-app cgroup CPU and memory limits, per-instance logs, OOM attribution, and restarts only for apps whose config changed.
- Built nightly PostgreSQL maintenance as Temporal workflows: VACUUM and ANALYZE ordered by anti-wraparound risk, bounded by a time window, load and WAL guards, plus policy-driven TimescaleDB retention, every run verified and charted.
- Moved dashboards off production databases onto scheduled snapshot tables, cutting chart loads from minutes to seconds, and led postmortems for OOM and slowdown incidents, from missing indexes to a Superset memory leak.
TemporalPostgreSQLTimescaleDBsystemdNode.jsPythonPrometheusGrafanaApache SupersetLinux- Built and operate a production PostgreSQL 17 primary-replica HA cluster with async WAL streaming replication across three machines, automated failover runbooks, zero-data-loss backup/restore, and fleet-wide multi-tenant data retention via dblink and pg_cron.
- Built an Ansible automation platform running in containerized Execution Environments (ansible-builder/ansible-navigator) with a custom-built AWX deployment, Vault-encrypted secrets, and playbooks for server bootstrap, GitHub provisioning, Elastic Agent rollout, and patch governance.
- Deployed and maintain a custom Dockerized Apache Superset analytics platform with Hive Metastore/Trino integration, Celery background workers, and an MCP server enabling AI assistant access to dashboards.
PostgreSQLAnsibleAWXDockerPrometheusGrafanaELK StackApache SupersetAzureLinux- Built "run", a schema-driven CLI (Ink/Pastel/TypeScript) for provisioning and maintaining Ubuntu dev servers with dependency-aware package installs, dry-run planning, and self-update, adopted fleet-wide via Ansible.
- Built the monitoring stack for a Temporal + PostgreSQL deployment: Prometheus scraping PostgreSQL exporter metrics remotely from a separate replica host, visualized in Grafana with alerting.
TypeScriptNode.jsTemporalPostgreSQLDockerPrometheusGrafanaLinuxBash
Writing
All postsFlattened Tables vs Denormalized Tables vs Materialized Views: the Decision Guide, and How Incremental Flattened Tables Fixed Superset
Three patterns make a dashboard query cheap — a denormalized table, a materialized view, and a flattened snapshot table — and they look alike until one of them takes the production database down. Measured story: a BI tool with stored-SQL virtual datasets was pushing 961 MB/s of buffer traffic into a shared primary from two open browser tabs. This post is the decision guide (including where each pattern breaks, and a rank-by-measurement rule for choosing) plus the production fix that took dashboards off the primary entirely: a dedicated reporting database, a resource-restricted ETL role, and incremental 15-minute refresh that recomputes only what changed.
PgBouncer From First Principles: Why a Busy Primary Needs a Pooler, and Every Line of Its Config
PostgreSQL forks a whole OS process per connection, so a dozen eager client pools can push a primary past 500 backends while under 6% of them run a query. This post builds PgBouncer from the wire up — transaction pooling and the per-backend state it breaks, named prepared statements, SCRAM pass-through so no password touches disk, a second HBA because Docker's published ports bypass iptables, and the sizing arithmetic that finally lowered the backend count — with the four things that broke along the way.
VACUUM vs VACUUM FULL vs pg_repack: Getting Disk Back, Holding Off Wraparound, and Keeping the Planner Honest
Plain VACUUM 'never shrinks the file'. VACUUM FULL shrinks it but is an outage. pg_repack does the same rewrite online for seconds of locking. When each one is the right call, how to measure bloat cheaply (including TOAST, which everyone forgets), the capacity arithmetic so you don't PANIC mid-run — and the two jobs that share VACUUM's name but not its purpose: the anti-wraparound FREEZE that keeps the 32-bit transaction clock from running out, and the ANALYZE statistics pass that keeps the planner honest. All of it grounded in a real incident.
Building a Zero-Downtime Load Balancer: Active-Passive HA with nginx, keepalived, and Go
How I built a complete active-passive high-availability load balancer — two nodes running nginx + a Go backend + keepalived/VRRP, with a floating virtual IP, full observability, and an automated test suite that proves failover actually works. The five design decisions that matter, how failure detection is layered, and why your availability claim is worthless without CI to back it up.
Stack
- Languages
- GoPythonTypeScriptBash
- Platform
- TemporalPostgreSQLPgBouncerTimescaleDBApache Superset
- Infrastructure
- LinuxsystemdDockerAnsibleAWXNginx
- Observability
- PrometheusGrafanaElastic Stack
Open source
GitHubGet in touch
Questions about reliability, Temporal or PostgreSQL, or a role you think I'd fit. Write here, or use your own mail.