Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Chaos Engineering Fundamentals

By Kokil Thapa | Last reviewed: September 2026

Production outages rarely arrive with a warning label. A payment callback stalls, a Redis node vanishes, or a deploy leaves PHP-FPM workers starved—and your team learns about resilience the hard way. Chaos Engineering Fundamentals flip that script: you deliberately inject controlled failures in real environments to prove your system survives them. This is not reckless sabotage. It is disciplined experimentation backed by SLOs, SLIs, and error budgets, observability, and rollback plans. If you run business-critical Laravel apps, APIs, or booking portals, chaos work belongs in your reliability toolkit alongside backups and monitoring.

What is chaos engineering and why does it matter in 2026?

Chaos engineering is the practice of experimenting on a system to build confidence in its ability to withstand turbulent conditions. Netflix popularised the approach after moving to AWS and needing proof that microservices could survive partial cloud failures. The core idea remains unchanged in 2026: hypothesis, inject failure, observe, learn, harden.

On production Laravel applications I maintain, the failures that hurt most are rarely exotic. They are mundane: database connection pool exhaustion, queue workers stuck on poison messages, stale cache after deploy, or a third-party SMS gateway timing out during peak booking hours. Chaos experiments surface those cracks while traffic is normal—not during Dashain sale spikes when every minute of downtime costs real NPR revenue.

Chaos Engineering Fundamentals LoopSteady StateDefine normalHypothesisIf X fails...ExperimentInject faultLearnFix gapsGuardrails RequiredObservability: metrics, logs, tracesBlast radius limits and auto rollbackOn-call engineer present during runError budget not already exhausted
Chaos Engineering Fundamentals follow a repeatable loop: define normal, hypothesise, inject controlled faults, then harden based on evidence.

The four principles you should not skip

The Principles of Chaos Engineering document defines a mature approach. Treat these as non-negotiable guardrails:

  1. Build a hypothesis around steady-state behaviour. Measure what "healthy" looks like before you break anything—checkout success rate, queue depth, p95 latency.
  2. Vary real-world events. Simulate server death, network latency, disk fill, or dependency timeout—not only unit-test mocks.
  3. Run experiments in production. Staging misses real traffic patterns, cache warmth, and config drift. Start with canary blast radius if full prod feels risky.
  4. Automate experiments to run continuously. One-off fire drills help; scheduled game days and CI-adjacent fault tests build lasting culture.

Chaos engineering complements—not replaces—load testing, integration tests, and penetration testing. Load tests ask "how much traffic can we take?" Chaos asks "what happens when something breaks mid-traffic?" Both questions matter for platforms like trek booking systems with supplier CRM integrations where a single API stall blocks confirmations.

How do you run your first chaos experiment safely?

Your first experiment should be boring on purpose. Pick a non-critical dependency, define abort conditions, and run during a low-traffic window with an engineer watching dashboards. The goal is learning the workflow—not proving heroics.

Step 1: Choose a measurable steady state

Steady state is a metric that reflects user-visible health—not CPU alone. Good examples for a Laravel 12 app on PHP 8.3:

  • HTTP 200 rate on /api/v1/bookings stays above 99.5% for five minutes
  • Queue job failure rate stays below 0.1%
  • Checkout completion p95 stays under 800 ms

Wire these into Prometheus or your existing APM stack before touching anything. If you cannot measure impact, you cannot run chaos safely.

Step 2: Write a one-page experiment card

Document every run. A minimal template:

Experiment: Redis cache unavailable for 60 seconds
Hypothesis: App falls back to DB; p95 latency rises but no 500 errors
Steady state: booking API success rate > 99.5%
Blast radius: single web node, staging first then prod canary
Abort if: error rate > 1% OR p95 > 3s for 30s
Rollback: restore Redis; verify queue workers reconnect
Owner: on-call engineer + observer

Store experiment cards in your repo beside runbooks. On sister sites I deploy with Deployer 7 and GitLab CI, the same discipline applies: versioned infra changes and versioned chaos procedures.

Step 3: Execute, observe, roll back

Run the fault. Watch dashboards for the full duration plus a ten-minute recovery window. Capture screenshots or export metric ranges. Roll back even if the experiment "succeeds"—you are validating recovery, not leaving systems degraded.

First Chaos Experiment PathStaging RunLow riskAbort GateMetrics OK?Prod Canary5% trafficDocumentFix + repeatExample: Laravel Redis Failure Testsudo iptables -A OUTPUT -p tcp --dport 6379 -j DROPWatch: cache miss rate, DB connections, 5xx countDuration: 60 seconds then iptables -D ruleNever run without on-call and rollback script ready
Start chaos experiments in staging, pass abort gates on steady-state metrics, then expand to a production canary with strict blast-radius limits.

Practical fault ideas for PHP/Laravel stacks

You do not need Kubernetes on day one. Common starter faults on Ubuntu servers with Apache and PHP-FPM:

  • Block outbound HTTPS to a non-critical third-party API for two minutes
  • Fill /tmp on one app server to test log rotation and disk alerts
  • Pause one queue worker container while others keep running
  • Introduce 500 ms latency to MySQL 8.4 on a read replica only
  • Simulate opcache stale code after deploy by reloading PHP-FPM mid-request burst

For REST APIs with rate limiting, test what happens when Redis—the typical throttle store—disappears. Does your middleware fail open and allow abuse, or fail closed and block legitimate clients? That behaviour should be intentional, not accidental.

What tools should you use for chaos engineering in production?

Tool choice depends on where your system runs. The table below maps common stacks to practical starting points. None of these replace observability; they only inject faults.

EnvironmentToolBest forLearning curve
AWS workloadsAWS Fault Injection SimulatorEC2, RDS, ECS fault actions with IAM guardrailsMedium
KubernetesLitmusChaos / Chaos MeshPod kill, network partition, IO stress in clustersHigh
VM / bare metalChaos Toolkit + shell hooksLaravel on Ubuntu, custom iptables/systemd faultsLow
Legacy Netflix stackChaos Monkey / Simian ArmyAuto instance termination in ASG environmentsMedium
Any HTTP serviceToxiproxyLatency, timeout, reset on TCP proxiesLow

On budget-sensitive Nepal client projects, I often start with Chaos Toolkit plus bash—not because it is flashy, but because it runs on existing Linux infrastructure without new cluster overhead. A Rs 0 tooling bill beats a Rs 50,000/month (~USD 375) managed chaos platform when the team is three people.

Chaos Toolkit example for HTTP latency

Install Chaos Toolkit and the HTTP probe extension, then define an experiment JSON file:

{
  "title": "Booking API tolerates 2s upstream delay",
  "steady-state-hypothesis": {
    "title": "API returns 200",
    "probes": [{
      "type": "probe",
      "name": "health-check",
      "tolerance": 200,
      "provider": {
        "type": "http",
        "url": "https://staging.example.com/health",
        "timeout": 5
      }
    }]
  },
  "method": [{
    "type": "action",
    "name": "add-latency",
    "provider": {
      "type": "process",
      "path": "toxiproxy-cli",
      "arguments": "latency -d 2000 booking_upstream"
    }
  }],
  "rollbacks": [{
    "type": "action",
    "name": "remove-latency",
    "provider": {
      "type": "process",
      "path": "toxiproxy-cli",
      "arguments": "reset booking_upstream"
    }
  }]
}

Validate JSON structure with a JSON formatter before committing. Broken experiment definitions have caused more downtime than the faults they intended to test.

Tool Fit by InfrastructureVM / LaravelChaos ToolkitToxiproxy + bashBest start pointAWS ManagedFIS + SSMRDS / ECS faultsIAM-controlledKubernetesLitmusChaosChaos MeshNeeds mesh opsShared Requirement: Observability LayerMetrics + structured logs + trace IDs on every requestAlert routes tested before fault injectionRunbooks linked from experiment cards
Match chaos tooling to your infrastructure: bash-friendly kits for Laravel VMs, FIS for AWS, and CNCF chaos operators for Kubernetes clusters.

How does chaos engineering relate to SRE and observability?

Site Reliability Engineering gives you the scoreboard; chaos engineering runs drills against that scoreboard. SLIs measure latency, availability, and correctness. SLOs set targets. Error budgets tell you how much failure you can absorb before feature work stops. Chaos experiments consume a slice of that budget on purpose—while you control the blast radius.

Without tracing, a Redis outage looks like "the site is slow." With OpenTelemetry or an APM trace, you see cache misses forcing N+1 Eloquent queries on the booking detail page. That is actionable. Tie experiment results to platform engineering runbooks so fixes become templates, not one-off heroics.

Game days vs continuous chaos

Game days are scheduled team exercises—quarterly works for many SMB teams. Continuous chaos automates small experiments weekly. A sensible 2026 progression:

  1. Quarter 1: staging game day, three documented experiments
  2. Quarter 2: production canary on one fault type
  3. Quarter 3: automate highest-value experiment in CI or cron
  4. Quarter 4: expand to multi-service scenarios (API + queue + payment webhook)

For legal-tech portals handling document uploads and payment collection—systems like those in our client portal portfolio work—I prioritise experiments on file storage and payment callback paths first. Users forgive slow pages more than lost documents or double charges.

What mistakes break chaos engineering programs?

Most chaos programs fail from organisational mistakes, not tooling gaps. Avoid these patterns I have seen on production deployments:

  • No steady-state metric. Teams inject faults and argue about whether results matter. Define numbers upfront.
  • Running experiments during incidents or deploys. You need a clean baseline. Freeze other changes.
  • Failing open on critical paths. Payment and auth should fail closed with clear errors—not silently corrupt state.
  • Skipping rollback drills. Injecting failure is half the test. Recovery is the other half.
  • Treating chaos as a one-off audit. Reliability decays as code changes. Re-run experiments after major releases.
  • Blast radius too large on day one. Killing every Redis node in prod teaches panic, not confidence.

Chaos work also intersects with API abuse prevention. When your rate limiter fails, do attackers flood you—or do legitimate mobile clients get blocked? Test that explicitly.

Should You Run Chaos Now?Error budget left?No: fix baselineYes: continueMetrics ready?No: add probesRun experimentOn-call present?Stop: rescheduleNoYesYesYesNo
Use a simple decision gate before any chaos run: confirm error budget, observability probes, and on-call coverage—or reschedule.

Multi-region and active-passive failover designs deserve dedicated chaos scenarios. Fail over manually during a game day before DNS automation gives you a false sense of security. The same applies to service mesh retries—retries can amplify outages if timeouts are wrong.

Document findings in postmortem format even when nothing breaks. "We survived Redis loss" is valuable evidence for stakeholders and for testing and optimisation engagements. Pair chaos results with ongoing maintenance retainers so fixes actually ship.

Key Takeaways

  • Define steady-state metrics tied to user outcomes before injecting any fault—never start with "let's break prod and see."
  • Run staging first, then production canaries with documented abort conditions and an on-call engineer watching dashboards.
  • Match tools to infrastructure: Chaos Toolkit and Toxiproxy for Laravel VMs, FIS for AWS, LitmusChaos for Kubernetes.
  • Tie every experiment to SLOs and error budgets so chaos consumes planned reliability debt, not surprise customer pain.
  • Automate your highest-value experiment after manual runs prove value—one game day is a start, not a program.
  • Prioritise payment, auth, document, and webhook paths—the failures that cause refunds, legal exposure, or data loss.

People Also Ask

Is chaos engineering the same as penetration testing?

No. Penetration testing hunts security vulnerabilities an attacker could exploit. Chaos engineering tests operational resilience—what happens when components fail or degrade under normal load. Both belong in a mature programme, but they answer different questions and use different tooling.

Can small teams practice chaos engineering without Kubernetes?

Yes. A two-person team running Laravel on Ubuntu can block a port with iptables, pause a systemd unit, or add Toxiproxy latency on staging. The fundamentals—hypothesis, measure, inject, rollback—do not require a service mesh or CNCF stack.

When should you NOT run chaos experiments?

Skip runs when your error budget is exhausted, during active incidents, mid-deploy, or when observability probes are missing. You need a known-good baseline and a clear rollback path. If those are absent, fix the foundation first.

How often should chaos experiments run?

Start quarterly game days. Once three experiment types pass in production canaries, automate the most valuable one on a weekly or post-deploy schedule. Frequency should match release cadence and risk tolerance—not a vendor marketing calendar.

Build resilience before the next outage finds you

Chaos Engineering Fundamentals are not about breaking things for sport. They are about proving—with data—that your Laravel apps, APIs, and eCommerce flows survive the failures you already know are possible. Start with one staging experiment this week. Document steady state, inject a small fault, fix what you learn, and repeat. The teams that practice controlled failure rarely meet their customers through unplanned downtime.

Need help designing fault-injection programmes, observability baselines, or production hardening for a Nepal or global deployment? Review our production portal work, read more on the engineering blog, or contact us to plan a resilience review. For infrastructure-heavy stacks, our speed and reliability practice pairs well with structured chaos work. See what clients say on customer reviews, or learn more about my production background on long-running systems since 2010.

Frequently Asked Questions

Chaos engineering is disciplined experimentation on a live system to prove it survives turbulent conditions. You define steady state, inject controlled faults, observe metrics, and harden weaknesses before real outages.

On production Laravel applications I maintain, the failures that hurt most are rarely exotic. They are mundane: database connection pool exhaustion, queue workers stuck on poison messages, stale cache after deploy, or a third-party SMS gateway timing out during peak booking hours. Chaos experiments surface those cracks while traffic is normal—not during Dashain sale spikes when every minute of downtime costs real NPR revenue. The fundamentals follow a repeatable loop: define normal, hypothesise, inject controlled faults, then harden based on evidence.

The Principles of Chaos Engineering document defines four non-negotiable guardrails. Build a hypothesis around steady-state behaviour and measure what healthy looks like before you break anything. Vary real-world events—server death, network latency, disk fill, dependency timeout—not only unit-test mocks. Run experiments in production because staging misses real traffic patterns, cache warmth, and config drift; start with a canary blast radius if full prod feels risky. Automate experiments to run continuously so scheduled game days and CI-adjacent fault tests build lasting culture, not one-off fire drills.

Your first experiment should be boring on purpose. Pick a non-critical dependency, define abort conditions, and run during a low-traffic window with an engineer watching dashboards. Choose a measurable steady state tied to user-visible health—booking API success rate above 99.5%, queue failure rate below 0.1%, checkout p95 under 800 ms—and wire it into Prometheus or your APM stack before touching anything. Write a one-page experiment card documenting hypothesis, blast radius, abort thresholds, rollback steps, and owners. Execute in staging first, observe through a ten-minute recovery window, then roll back even if the experiment succeeds.

Steady state is a metric reflecting user-visible health—not CPU alone. Good examples for a Laravel 12 app on PHP 8.3 include HTTP 200 rate on /api/v1/bookings staying above 99.5% for five minutes, queue job failure rate below 0.1%, and checkout completion p95 under 800 ms. Wire these into Prometheus or your existing APM stack before injecting any fault. If you cannot measure impact, you cannot run chaos safely. Steady state becomes your abort gate: if error rate exceeds 1% or p95 exceeds 3 seconds for 30 seconds, stop the experiment and roll back immediately.

You do not need Kubernetes on day one. On Ubuntu servers with Apache and PHP-FPM, common starter faults include blocking outbound HTTPS to a non-critical third-party API for two minutes, filling /tmp on one app server to test log rotation and disk alerts, pausing one queue worker while others keep running, introducing 500 ms latency to MySQL 8.4 on a read replica only, and simulating opcache stale code after deploy by reloading PHP-FPM mid-request burst. For REST APIs with rate limiting, test what happens when Redis—the typical throttle store—disappears: does middleware fail open and allow abuse, or fail closed and block legitimate clients?

Tool choice depends on where your system runs. AWS Fault Injection Simulator suits EC2, RDS, and ECS workloads with IAM guardrails. LitmusChaos and Chaos Mesh handle pod kill, network partition, and IO stress in Kubernetes clusters. Chaos Toolkit plus shell hooks works well for Laravel on Ubuntu with custom iptables or systemd faults. Toxiproxy adds latency, timeout, and reset on TCP proxies for any HTTP service. On budget-sensitive Nepal client projects, I often start with Chaos Toolkit plus bash—it runs on existing Linux infrastructure without new cluster overhead. None of these replace observability; they only inject faults.

Load testing asks how much traffic a system can take. Chaos engineering asks what happens when something breaks mid-traffic. Penetration testing hunts security vulnerabilities an attacker could exploit; chaos engineering tests operational resilience when components fail or degrade under normal load. All three belong in a mature programme, but they answer different questions and use different tooling. For platforms like trek booking systems with supplier CRM integrations, a single API stall blocking confirmations is a chaos problem, not a load or security problem.

Site Reliability Engineering gives you the scoreboard; chaos engineering runs drills against that scoreboard. SLIs measure latency, availability, and correctness. SLOs set targets. Error budgets tell you how much failure you can absorb before feature work stops. Chaos experiments consume a slice of that budget on purpose while you control blast radius. Without tracing, a Redis outage looks like the site is slow. With OpenTelemetry or an APM trace, you see cache misses forcing N+1 Eloquent queries on a booking detail page. Tie experiment results to platform engineering runbooks so fixes become templates, not one-off heroics.

Yes. A two-person team running Laravel on Ubuntu can block a port with iptables, pause a systemd unit, or add Toxiproxy latency on staging. The fundamentals—hypothesis, measure, inject, rollback—do not require a service mesh or CNCF stack.

Skip runs when your error budget is exhausted, during active incidents, mid-deploy, or when observability probes are missing. You need a known-good baseline and a clear rollback path first.

Start with quarterly game days. Once three experiment types pass in production canaries, automate the most valuable one on a weekly or post-deploy schedule. A sensible 2026 progression runs staging game days in Quarter 1, production canaries on one fault type in Quarter 2, automated highest-value experiments in CI or cron during Quarter 3, and multi-service scenarios covering API, queue, and payment webhook paths in Quarter 4. Frequency should match release cadence and risk tolerance—not a vendor marketing calendar.

Game days are scheduled team exercises—quarterly works for many SMB teams—where engineers inject faults together and discuss findings. Continuous chaos automates small experiments weekly so resilience checks happen without calendar coordination. One game day is a start, not a program. Reliability decays as code changes, so re-run experiments after major releases. For legal-tech portals handling document uploads and payment collection, I prioritise game-day scenarios on file storage and payment callback paths first because users forgive slow pages more than lost documents or double charges.

Most programs fail from organisational mistakes, not tooling gaps. Avoid injecting faults without a defined steady-state metric, running during incidents or deploys, failing open on payment and auth paths, skipping rollback drills, treating chaos as a one-off audit, and setting blast radius too large on day one—killing every Redis node in prod teaches panic, not confidence. Test explicitly what happens when your rate limiter fails: do attackers flood you or do legitimate mobile clients get blocked? Use a decision gate before any run—confirm error budget, observability probes, and on-call coverage—or reschedule.

Tooling cost can be near zero when you use Chaos Toolkit and bash on existing Ubuntu infrastructure. On budget-sensitive Nepal client projects with three-person teams, a Rs 0 tooling bill beats a Rs 50,000 per month (~USD 375) managed chaos platform when the team lacks cluster overhead. The real investment is engineer time: defining steady-state metrics, writing experiment cards, watching dashboards during runs, and shipping fixes afterward. Pair chaos results with ongoing maintenance retainers so hardening work actually ships rather than sitting in postmortem documents.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: