A liveness probe is a continuous health check that answers the binary question: "Is this container alive?" Unlike a readiness probe, which determines if an application is prepared to accept traffic, a liveness probe detects a deadlock or stuck state where the process exists but cannot make progress. When the probe fails, the orchestration platform—typically Kubernetes—terminates the container and restarts it according to the pod's restartPolicy, restoring the system to a known-good state.
Glossary
Liveness Probe

What is a Liveness Probe?
A liveness probe is a specific diagnostic check used by container orchestration systems to determine if an application's core process is running but has become unresponsive or deadlocked, triggering an automatic restart.
The probe executes a configured action—an HTTP GET request, a TCP socket check, or a command execution inside the container—at a defined periodSeconds interval. A failure is declared after failureThreshold consecutive unsuccessful attempts, at which point the kubelet kills the container. Properly tuning initialDelaySeconds prevents premature restarts during slow initialization, distinguishing a genuine deadlock from a lengthy startup sequence.
Key Characteristics of a Liveness Probe
A liveness probe is a specific diagnostic check used by an orchestration system to determine if an agent's core process is running but has become unresponsive or deadlocked, triggering a restart. Unlike readiness probes, liveness probes focus on internal health rather than startup state.
Deadlock Detection
The primary function of a liveness probe is to identify deadlocks—states where the agent process exists but cannot make progress. This typically manifests as an infinite loop, resource contention, or a thread pool exhaustion. The probe does not check if the agent is correct, only if it is alive. A common implementation is a /healthz HTTP endpoint that returns a 200 status code only if the main event loop is still cycling. If the probe fails, the orchestrator (e.g., Kubernetes kubelet) sends a SIGTERM signal and restarts the container.
Internal vs. External Checks
Liveness probes must test the internal state of the agent, not just the process table. A naive check that only verifies the PID exists will miss a deadlocked process.
- Internal Check: The agent exposes an endpoint that validates its own event loop, memory health, and sub-component connectivity.
- External Check: The orchestrator monitors resource metrics like CPU usage flatlining at 100% or memory growth without garbage collection.
A robust probe combines both: a lightweight internal
/liveendpoint backed by external metric thresholds.
Lightweight Execution Path
A liveness probe must be computationally trivial. It should execute in milliseconds and avoid any dependency on external services. If the probe itself queries a database or calls a remote API, a network partition could cause a false-positive failure and trigger an unnecessary restart cascade. Best practices dictate that the probe handler runs on a dedicated, high-priority thread and returns a simple boolean or HTTP status code. Avoid logging, complex serialization, or lock acquisition within the probe path.
Timeout and Threshold Tuning
Misconfigured probe thresholds are a leading cause of flapping—where an agent is repeatedly killed and restarted. Key parameters include:
- initialDelaySeconds: Time to wait before the first probe, allowing the agent to initialize.
- periodSeconds: Frequency of the check (e.g., every 10 seconds).
- failureThreshold: Number of consecutive failures before a restart is triggered (e.g., 3).
- timeoutSeconds: Maximum time to wait for a probe response.
Setting the
timeoutSecondstoo low on a garbage-collection-heavy agent can cause false restarts.
Separation from Readiness Probes
A critical architectural distinction exists between liveness and readiness probes. A liveness probe failure results in a hard restart—the container is killed and recreated. A readiness probe failure simply removes the pod from the service load balancer, allowing it to recover without termination. Confusing the two is dangerous: if a temporary database connection blip triggers a liveness probe failure, the entire agent restarts, causing cascading state loss. Liveness probes should only fail on irrecoverable internal states.
Sidecar and Process Monitoring
In sidecar architectures, a dedicated watchdog process can act as the liveness probe target. The main agent process writes a heartbeat to a shared file or Unix socket, and the sidecar exposes the /live endpoint. If the heartbeat stops updating, the sidecar returns a 503, and the orchestrator restarts the entire pod. This pattern decouples the probe logic from the agent code and prevents a deadlocked agent from blocking its own health reporting. Tools like supervisord or custom Go routines implement this pattern.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Essential questions about how orchestration systems detect and recover from deadlocked or unresponsive agent processes using liveness probes.
A liveness probe is a specific diagnostic check used by an orchestration system (like Kubernetes) to determine if an agent's core process is running but has become unresponsive or deadlocked, triggering an automatic restart. Unlike a readiness probe, which determines if an agent is prepared to accept work, the liveness probe answers the binary question: 'Is this process alive or should it be killed?' The kubelet on each node periodically executes the probe—typically an HTTP GET request, a TCP socket check, or a command execution inside the container—and evaluates the result against a configured failure threshold. If the probe fails consecutively beyond the failureThreshold, the container runtime terminates the container and restarts it according to the pod's restartPolicy. This mechanism resolves deadlocks, infinite loops, and memory leaks that leave a process technically running but functionally frozen.
Related Terms
A liveness probe is one component of a broader health-check ecosystem. These related mechanisms work together to detect failure modes, enforce safety boundaries, and maintain operational integrity in autonomous systems.
Watchdog Timer
A hardware or software timer that monitors an agent's operation and triggers a corrective action if the agent fails to periodically signal that it is functioning correctly. The agent must pet the watchdog by resetting the timer at regular intervals. If the timer expires, the system assumes a fault and initiates a reset. This is the embedded-systems precursor to the liveness probe pattern.
Circuit Breaker Pattern
A software design pattern that prevents an agent from repeatedly attempting an operation that is likely to fail. When failure thresholds are exceeded, the circuit trips to an open state, immediately failing calls for a set timeout period. This differs from a liveness probe: the circuit breaker protects downstream dependencies, while the liveness probe protects the agent process itself from deadlock.
Runaway Process Terminator
An automated monitor that detects and kills agent processes consuming excessive or unexpected system resources:
- CPU spikes beyond defined thresholds
- Memory leaks exceeding container limits
- Network bandwidth anomalies indicating infinite loops This complements liveness probes by catching resource-exhaustion failures that may not trigger a deadlock but still render the agent non-functional.
Timeout-Based Kill
An automatic termination mechanism that issues a kill command if a single operation or entire task does not complete within a predefined maximum duration. While a liveness probe checks process responsiveness, a timeout-based kill enforces execution deadlines on specific work units. Together they provide defense-in-depth against both hung processes and hung operations.
Orphan Process Reaper
A system component responsible for identifying and cleaning up child processes that were spawned by an agent but continue to run after the parent agent has been terminated. When a liveness probe triggers a restart, the reaper ensures that zombie processes and leaked resources are reclaimed, preventing resource exhaustion across the orchestration cluster.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us