Mid 8 min · May 23, 2026

Service Discovery with Spring Cloud Eureka

Master Spring Cloud Eureka service discovery: @EnableEurekaServer, client registration, heartbeat tuning, self-preservation pitfalls, and zone-aware routing.

N
Naren · Founder
Plain-English first. Then code. Then the interview question.
About
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Annotate your server app with @EnableEurekaServer and add spring-cloud-starter-netflix-eureka-server dependency
  • Clients register with @EnableDiscoveryClient (or auto-configured) and spring-cloud-starter-netflix-eureka-client
  • Tune heartbeat with eureka.instance.lease-renewal-interval-in-seconds (default 30s) and lease-expiration-duration-in-seconds (default 90s)
  • Self-preservation mode prevents mass de-registration during network partitions — disable only in dev (eureka.server.enable-self-preservation=false)
  • Zone-aware routing uses eureka.instance.metadata-map.zone to prefer same-zone instances
✦ Definition~90s read
What is Service Discovery with Spring Cloud Eureka?

Spring Cloud Eureka is a REST-based service registry built on Netflix's open-sourced Eureka 1.x, wrapped with Spring Boot auto-configuration. It consists of two components: the Eureka Server (a standalone Spring Boot app annotated with @EnableEurekaServer) that stores the service registry, and the Eureka Client embedded in every microservice that handles registration, heartbeat renewal, and local registry caching.

Eureka is like a hotel concierge who keeps a live directory of every service currently open for business.

The client registers with its applicationName (spring.application.name), hostname, port, and an optional metadata map. It then sends a heartbeat (a PUT /eureka/apps/{appName}/{instanceId} request) every lease-renewal-interval-in-seconds seconds. If the server does not receive a heartbeat within lease-expiration-duration-in-seconds, it marks the instance as UNKNOWN and eventually evicts it.

Consumers call GET /eureka/apps to retrieve the full registry or GET /eureka/apps/{appName} for a specific service and cache the result locally with a TTL controlled by eureka.client.registry-fetch-interval-seconds.

Self-preservation mode activates when the percentage of received heartbeats drops below eureka.server.renewal-percent-threshold (default 0.85). In this state the server stops expiring any instances, protecting against false de-registrations caused by network partitions between the server and its clients. This is the single most misunderstood Eureka feature in production environments.

Plain-English First

Eureka is like a hotel concierge who keeps a live directory of every service currently open for business. When your microservice starts up, it checks in with the concierge; when it shuts down, it checks out. Any other service that wants to call it asks the concierge for the current room number instead of hardcoding an address.

In a monolithic application you know exactly where your database and downstream APIs live — they have fixed hostnames in a config file and they stay there. Microservices shattered that comfort zone. A single product page might need to call inventory, pricing, review, and recommendation services, each deployed as an auto-scaling group that assigns a new IP every time a container restarts. Hardcoding those addresses is a recipe for 3 AM pages.

Spring Cloud Eureka solves this with a client-side service registry. Every microservice registers itself on startup, renews its lease every 30 seconds, and de-registers on graceful shutdown. Consumers fetch the registry once and cache it locally, falling back to the cached copy if the Eureka server is briefly unavailable. That local cache is what gives Eureka its resilience story.

The production pain point most teams discover too late is self-preservation mode. When the Eureka server stops receiving enough heartbeats — maybe because of a network hiccup, not because services actually died — it refuses to expire registrations to avoid a cascading de-registration event. This is the right behavior in production but baffling in development when you kill a service and it stays in the registry for minutes.

Zone-aware routing is Eureka's answer to latency. In a multi-AZ or multi-region deployment, you want service A in us-east-1a to prefer instances of service B also in us-east-1a before crossing AZ boundaries. Eureka's metadata map and Spring Cloud LoadBalancer's ZonePreferenceServiceInstanceListSupplier wire this together with minimal config.

Health check integration bridges the gap between Eureka's heartbeat mechanism and Spring Boot Actuator's richer health indicators. By default Eureka only knows a service is alive if it can send a heartbeat; with health check callbacks enabled it also considers the /actuator/health status, so a service with a broken database connection is correctly marked DOWN in the registry even though the JVM is running.

This guide covers all of these concerns with production-tested configuration, real incident post-mortems, and the exact commands you need when something goes wrong at 2 AM.

Setting Up the Eureka Server

The Eureka Server is a standalone Spring Boot application. You need spring-cloud-starter-netflix-eureka-server on the classpath and the @EnableEurekaServer annotation on your main application class. By default, the server also tries to register itself as a client — in a standalone setup you must disable this.

The server exposes a dashboard at / and the REST API at /eureka/apps. The dashboard is invaluable for debugging but should be secured in production with Spring Security. The REST API is what clients use and should be accessible from your service network.

For high availability, run at least two Eureka server instances and have each register with the other. This peer-to-peer replication means each server maintains a full copy of the registry. Use DNS round-robin or a load balancer in front of the Eureka cluster and point all clients at that address. In AWS, a common pattern is one Eureka instance per AZ with cross-AZ peer replication.

Server configuration requires careful tuning of the eviction intervals. The default eviction task runs every 60 seconds, which means a dead instance can live in the registry for up to 90+60=150 seconds. In latency-sensitive systems, reduce both lease-expiration-duration-in-seconds and eviction-interval-timer-in-ms together.

Never Disable Self-Preservation in Production
Setting eureka.server.enable-self-preservation=false means Eureka will aggressively evict instances during any network blip, causing healthy services to disappear from the registry. Only disable it in local development environments where you need immediate de-registration.
Production Insight
Run at minimum two Eureka servers in different AZs; a single Eureka server is a single point of failure for your entire service mesh.
Key Takeaway
A properly configured Eureka Server needs @EnableEurekaServer, self-registration disabled in standalone mode, security enabled, and peer replication URLs for HA.

Registering Eureka Clients

The Eureka client is auto-configured when spring-cloud-starter-netflix-eureka-client is on the classpath and spring.application.name is set. The @EnableDiscoveryClient annotation is optional in modern Spring Cloud versions but serves as explicit documentation of intent.

At startup, the client sends a POST /eureka/apps/{appName} request with a JSON payload containing the instance metadata: hostname, IP address, port, secure port, health check URL, homepage URL, and the metadata map. This registration happens in a background thread after the application context is fully started.

The most important client-side tuning parameters are the heartbeat interval and the registry fetch interval. Reducing the heartbeat interval means faster detection of dead instances (at the cost of more network traffic). Reducing the registry fetch interval means consumers see new registrations faster (also at the cost of more traffic). In a large deployment with hundreds of instances, be conservative with these values.

The preferIpAddress setting is important in containerized environments where hostname resolution is unreliable. Setting eureka.instance.prefer-ip-address=true makes the client register with its IP address, and instance-id should be set to something unique like ${spring.application.name}:${spring.application.instance_id:${random.value}} to avoid collisions when multiple instances run on the same host.

For Kubernetes deployments, you often want to register with the pod IP rather than the node hostname. Combine prefer-ip-address=true with a liveness probe that matches your health check URL, and set the initial registration delay to give the pod time to become ready before it starts receiving traffic from the registry.

Enable Health Check Callbacks
Set eureka.client.healthcheck.enabled=true to make Eureka respect your /actuator/health status. Without this, a service with a broken DB connection reports UP in Eureka (because the JVM heartbeat works fine) and continues receiving traffic it cannot serve.
Production Insight
In Kubernetes, set lease-renewal-interval-in-seconds=10 and lease-expiration-duration-in-seconds=30 to match pod lifecycle speeds; the defaults are tuned for VMs.
Key Takeaway
Client registration is automatic with the right starter; tune heartbeat intervals, enable health check callbacks, and use IP addresses in containerized environments.

Self-Preservation Mode Deep Dive

Self-preservation is Eureka's defense against the split-brain problem in distributed systems. The server tracks the number of heartbeats it expects to receive per minute based on all registered instances. When the actual heartbeat rate drops below 85% of the expected rate, the server assumes it's experiencing a network issue and stops expiring instances.

The math: if you have 100 instances each sending a heartbeat every 30 seconds, the server expects 200 heartbeats per minute. If only 150 arrive (75%), self-preservation activates. The server now holds all 100 instances in the registry even if some have genuinely died.

Why this is correct behavior: without self-preservation, a temporary network partition between the Eureka server and a subset of healthy services would cause those services to be evicted, even though they're actively serving traffic. Consumers would then stop sending them traffic, causing unnecessary downtime.

Why this causes confusion: during a rolling deployment when you're intentionally terminating old instances, self-preservation can cause Eureka to hold the dead instances for much longer than the lease-expiration-duration-in-seconds value suggests, because the eviction task checks if self-preservation is active before evicting.

The correct approach for deployments is to ensure graceful shutdown so instances de-register themselves before being terminated. This does not trigger self-preservation because de-registration is an explicit API call, not a missed heartbeat. Only use eureka.server.enable-self-preservation=false in development or staging environments where you need fast cleanup after testing.

Self-Preservation Threshold Recalculation
The expected heartbeat count is recalculated every renewal-threshold-update-interval-ms (default 15 minutes). After a large scale-in event, it takes up to 15 minutes before the threshold adjusts. Plan deployments that reduce instance count significantly with this lag in mind.
Production Insight
Self-preservation activating during a deployment usually means you're killing instances without graceful shutdown — fix the deployment process, not the self-preservation setting.
Key Takeaway
Self-preservation protects against false de-registration during network partitions; solve it with graceful shutdown and health check integration, not by disabling it.

Zone-Aware Routing with Eureka

Zone-aware routing reduces cross-AZ latency and data transfer costs by preferring service instances in the same availability zone. In AWS, cross-AZ traffic within a region costs $0.01/GB in each direction — in a high-throughput system this adds up quickly and also adds 1-3ms of latency compared to same-AZ calls.

Eureka implements zone awareness through instance metadata. Each instance registers with a zone label in its metadata map, and the load balancer (Spring Cloud LoadBalancer in modern Spring Cloud, previously Ribbon) uses this metadata to prefer same-zone instances. The fallback when no same-zone instances are available is to use instances from other zones.

Configuration requires setting the zone on both the provider (so Eureka knows which zone the instance is in) and on the consumer (so LoadBalancer knows which zone to prefer). In AWS, the zone should match the EC2 availability zone label (us-east-1a, us-east-1b, etc.). In ECS and EKS, inject this via environment variables from the instance metadata service.

The ZonePreferenceServiceInstanceListSupplier in Spring Cloud LoadBalancer is the modern implementation. It wraps another ServiceInstanceListSupplier and filters the list to prefer same-zone instances. If no same-zone instances are available, it falls back to the full list. This fallback is important — never configure zone routing in a way that causes NoInstanceAvailableException when a zone is down.

Inject Zone from Instance Metadata
Never hardcode the availability zone. Use the EC2 Instance Metadata Service (IMDS) endpoint or EKS Downward API to inject the zone at runtime. This makes your AMI or container image portable across AZs without config changes.
Production Insight
Zone-aware routing pays for itself in high-throughput services — at 10k RPS with average 100KB payloads, cross-AZ data transfer costs ~$2600/month that zone preference eliminates.
Key Takeaway
Zone awareness requires metadata on both provider and consumer; use Spring Cloud LoadBalancer's ZonePreferenceServiceInstanceListSupplier and inject the AZ from instance metadata.

Health Check Integration and Instance Status Management

Eureka's default heartbeat mechanism only confirms that the JVM process is alive and the heartbeat thread is running. It does not verify that the application is actually capable of serving requests. A service with a broken database connection, a saturated thread pool, or a crashed internal executor will still send heartbeats and remain in the registry as UP.

Spring Boot Actuator's /actuator/health endpoint aggregates health indicators from all registered components: datasource health, Redis connectivity, disk space, custom business health checks, and more. By enabling eureka.client.healthcheck.enabled=true, you instruct the Eureka client to periodically check the local /actuator/health endpoint and update the instance status in the registry accordingly. If health returns DOWN, the instance status in Eureka is updated to DOWN and consumers will not route traffic to it.

You can also programmatically control instance status using the EurekaClient or ApplicationInfoManager. This is useful for implementing blue-green deployments, graceful pre-shutdown draining, or maintenance mode. Setting the status to OUT_OF_SERVICE removes the instance from consumer registries without de-registering it — it comes back as UP when the status is reset.

Custom health indicators let you define exactly what 'healthy' means for your service. A payment service might include a health check that verifies it can reach the payment gateway. An inventory service might check that its local cache is warm. These business-level health checks, surfaced through Actuator and propagated to Eureka, give you much more accurate traffic routing than a simple JVM heartbeat.

Health Check Polling Adds Latency to Status Changes
With eureka.client.healthcheck.enabled=true, the health check runs on the client's heartbeat interval (default 30s). A service that becomes unhealthy may stay UP in Eureka for up to 30 seconds. Reduce heartbeat interval to 10s for faster propagation, or use the programmatic OUT_OF_SERVICE approach for planned maintenance.
Production Insight
Always implement a graceful shutdown hook that marks the instance OUT_OF_SERVICE, sleeps 10-15 seconds for connection draining, then calls eurekaClient.shutdown() before the JVM exits.
Key Takeaway
Enable health check callbacks and implement custom health indicators to ensure Eureka reflects actual service capability, not just JVM liveness.

High Availability and Production Hardening

A single Eureka server is a single point of failure. All consumers cache the registry locally, so they can survive a brief Eureka outage, but new instances cannot register and the registry cannot be updated. For true HA, run a cluster of 2-3 Eureka servers with peer replication enabled.

In AWS, the recommended topology is one Eureka instance per AZ, each registered with the others. Use an internal Application Load Balancer or Route 53 round-robin DNS in front of the cluster. Clients should have the ALB/DNS address in their service-url — this way clients are not affected if one Eureka server fails and is replaced with a new IP address.

Eureka server memory requirements are modest — typically 512MB-1GB heap for a deployment of 100-200 services with multiple instances each. However, GC pauses can interrupt heartbeat processing. Use G1GC with a max pause time target of 200ms, and monitor GC pause times as a leading indicator of Eureka health.

Rate limiting on the Eureka server is often overlooked. At startup, all service instances attempt to register simultaneously, creating a thundering herd. The server can handle this, but it's worth staggering startup in your deployment pipeline. Similarly, if a Eureka server restarts, all clients will simultaneously attempt to re-fetch the full registry — implement exponential backoff in clients via eureka.client.initial-instance-info-replication-interval-seconds.

Security hardening requires Spring Security on the Eureka server with at minimum HTTP Basic auth. Use TLS everywhere — between clients and server, and between peer Eureka servers. In a zero-trust network architecture, use mutual TLS (mTLS) so only authorized services can register.

CSRF Must Be Disabled for Eureka Endpoints
Eureka clients use PUT/POST/DELETE requests for heartbeats and registration without CSRF tokens. When adding Spring Security to a Eureka server, always disable CSRF for the /eureka/** path matcher, or all client operations will fail with 403.
Production Insight
Monitor eureka.server.num-of-replicas-synced-last-min via Actuator metrics; if it drops to 0 on a peer-replication node, the cluster has split and stale data is being served.
Key Takeaway
Run a 3-node Eureka cluster behind an internal load balancer, secure with Basic auth over TLS, and monitor peer replication metrics as your primary HA health signal.
● Production incidentPOST-MORTEMseverity: high

Ghost Instances Serving 503s After Blue-Green Deployment

Symptom
POST /orders returned 503 sporadically for 3 minutes after a successful blue-green deployment. Error rate spiked to 40% in Datadog.
Assumption
The team assumed Eureka de-registers instances immediately on ALB target group removal and that the 503s were a brief propagation delay.
Root cause
The blue instances were terminated via Auto Scaling group scale-in without triggering a graceful JVM shutdown, so Eureka never received a de-registration request. The lease-expiration-duration-in-seconds was left at the default 90 seconds. Self-preservation mode was also active (normal production behavior), so Eureka held the stale registrations even longer than 90 seconds.
Fix
Added a pre-termination lifecycle hook that sends a SIGTERM and waits for the Spring Boot graceful shutdown (spring.lifecycle.timeout-per-shutdown-phase=30s) before allowing the instance to terminate. Reduced lease-expiration-duration-in-seconds to 30s for faster eviction of ungracefully terminated instances in their environment. Enabled health check callbacks so instances with failing health are removed proactively.
Key lesson
  • Eureka de-registration only happens on graceful JVM shutdown.
  • In cloud environments where VMs or containers are terminated externally, you must either ensure graceful shutdown hooks run or reduce lease TTLs and accept the tradeoff of more aggressive eviction.
Production debug guideSymptom → root cause → fix5 entries
Symptom · 01
Service registered in Eureka but consumers get 'No instances available'
Fix
Check the instance status in the Eureka dashboard or GET /eureka/apps/{appName}. If status is STARTING, the health check hasn't passed yet — verify /actuator/health returns UP. If status is OUT_OF_SERVICE, a programmatic call to EurekaClient.shutdown() or a /actuator/service-registry?status=OUT_OF_SERVICE was made. If status is UP but consumers still fail, the consumer's local cache may be stale — check eureka.client.registry-fetch-interval-seconds and wait one TTL cycle.
Symptom · 02
Eureka dashboard shows 'EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT'
Fix
This is the self-preservation mode banner — not a bug, by design. The server received fewer heartbeats than the renewal-percent-threshold in the last minute. Check if there's a network partition between the Eureka server and clients, or if a large batch of instances was recently terminated. In a stable environment this banner should clear within 1-2 minutes. If it persists, check GC pauses on the Eureka server (long GC can starve the heartbeat processing thread) and verify the server heap is adequately sized.
Symptom · 03
After redeployment, old instances remain in the registry for 90+ seconds
Fix
Confirm whether your deployment process triggers a graceful JVM shutdown (SIGTERM followed by the Spring lifecycle shutdown hooks). If using Kubernetes, ensure terminationGracePeriodSeconds is greater than your spring.lifecycle.timeout-per-shutdown-phase. If graceful shutdown is not feasible, reduce eureka.instance.lease-expiration-duration-in-seconds to 15-30s and accept slightly more aggressive eviction. Also consider enabling eureka.client.healthcheck.enabled=true so unhealthy instances are de-registered faster.
Symptom · 04
Zone-aware routing not working; all traffic goes to instances in a different AZ
Fix
Verify that eureka.instance.metadata-map.zone is set identically on both the provider instances and that the consumer's eureka.client.availability-zones and eureka.client.region are configured. Confirm that the Spring Cloud LoadBalancer dependency is on the classpath (not Ribbon, which is EOL) and that ZonePreferenceServiceInstanceListSupplier is active — add spring.cloud.loadbalancer.zone=us-east-1a to the consumer's config.
Symptom · 05
Eureka server out of memory / slow dashboard
Fix
The in-memory registry scales with the number of instances × renewal frequency. Check the number of registered instances and reduce eureka.server.eviction-interval-timer-in-ms from the default 60000ms if instance counts are very high. Increase server heap and enable G1GC. For very large deployments (500+ instances) consider multiple Eureka server zones with peer replication, or migrate to a more scalable registry like Consul.
★ Debug Cheat SheetFast diagnosis commands for Eureka issues in production
Service not appearing in Eureka registry
Immediate action
Check client logs for 'DiscoveryClient_* - registration status: 204'
Commands
curl -s http://eureka-server:8761/eureka/apps | python3 -m json.tool | grep -A5 'YOUR-SERVICE'
curl -s http://your-service:8080/actuator/health | python3 -m json.tool
Fix now
Ensure eureka.client.service-url.defaultZone is set and reachable; check spring.application.name is not 'application' (the default)
Stale instances not evicted+
Immediate action
Manually de-register via DELETE request to Eureka REST API
Commands
curl -X DELETE http://eureka-server:8761/eureka/apps/YOUR-SERVICE/your-service:8080
curl -s http://eureka-server:8761/eureka/apps/YOUR-SERVICE | grep -i status
Fix now
Reduce lease-expiration-duration-in-seconds to 30 and enable health check callbacks in your next deploy
Self-preservation mode stuck active+
Immediate action
Check heartbeat rate in Eureka server logs
Commands
curl -s http://eureka-server:8761/actuator/metrics/eureka.server.num-of-replicas-synced-last-min
grep 'renewals threshold' $(find /var/log -name '*.log' | head -1) | tail -5
Fix now
Identify and restart any clients with stalled heartbeat threads; if network partition, restore connectivity and wait 2 minutes for self-preservation to clear
Eureka peer replication errors+
Immediate action
Verify all Eureka server URLs in the cluster are resolvable from each server
Commands
curl -s http://eureka-server-1:8761/eureka/apps | grep -c 'instanceId'
curl -v http://eureka-server-2:8761/eureka/apps/EUREKA 2>&1 | grep '< HTTP'
Fix now
Ensure each Eureka server lists ALL other servers in eureka.client.service-url.defaultZone; DNS resolution must work between server nodes
Eureka vs Consul vs Kubernetes Service Discovery
FeatureEurekaConsulKubernetes DNS
Health check modelHeartbeat (client-push)Active probe (server-pull)Liveness/Readiness probes
Client library requiredYes (Spring Cloud)Yes or agentNo (DNS built-in)
Multi-datacenterManual replicationBuilt-in WAN federationRequires federation
Key-value storeNoYesConfigMap/Secret
ACL/SecurityBasic Auth + TLSToken-based ACL + TLSRBAC + NetworkPolicy
Self-preservationYes (built-in)Circuit-breaker styleNot applicable
Spring Boot integrationExcellent (native)Good (Spring Cloud Consul)Good (Spring Cloud K8s)
Operational complexityLowMediumLow (managed K8s)

Key takeaways

1
Eureka uses a client-side registry model where consumers cache the full registry locally, providing resilience when the Eureka server is temporarily unavailable
2
Self-preservation mode is a safety feature that prevents cascading de-registrations during network partitions
never disable it in production
3
Enable health check callbacks (eureka.client.healthcheck.enabled=true) so Eureka reflects actual application health, not just JVM liveness
4
Run a minimum 2-node Eureka cluster behind an internal load balancer for HA; monitor peer replication metrics as the primary cluster health signal
5
Graceful shutdown
marking OUT_OF_SERVICE, draining connections, then calling eurekaClient.shutdown() — is essential to prevent traffic to dead instances during deployments

Common mistakes to avoid

6 patterns
×

Disabling self-preservation in production

Symptom
Services randomly disappear from the registry during network hiccups, causing 503 spikes
Fix
Keep enable-self-preservation=true in production; fix the root cause (graceful shutdown, health checks) instead of disabling the protective mechanism
×

Not setting spring.application.name

Symptom
All services register under the name 'UNKNOWN' or 'APPLICATION' and cannot be discovered by name
Fix
Always set spring.application.name in bootstrap.yml or application.yml; this is the service name consumers use to look up instances
×

Pointing all clients directly at individual Eureka server IPs instead of a load balancer

Symptom
When one Eureka server is replaced (new IP), all clients pointed at the old IP lose their registry connection
Fix
Put an internal load balancer or Route 53 DNS record in front of the Eureka cluster; clients should use the stable DNS name
×

Forgetting to disable CSRF for /eureka/** when adding Spring Security

Symptom
All Eureka client operations (registration, heartbeat, de-registration) fail with HTTP 403 Forbidden
Fix
Add csrf.ignoringRequestMatchers("/eureka/**") to your security config; Eureka clients do not send CSRF tokens
×

Using the same Eureka URL for both peer replication and client registration in HA mode

Symptom
Peer replication works but clients only connect to one server; no failover when that server dies
Fix
Put all Eureka server URLs in the client's eureka.client.service-url.defaultZone as a comma-separated list for client-side failover
×

Not enabling health check callbacks (eureka.client.healthcheck.enabled=false, the default)

Symptom
Services with broken database connections or saturated thread pools remain UP in Eureka and receive traffic they cannot serve
Fix
Set eureka.client.healthcheck.enabled=true and implement meaningful health indicators for all critical dependencies
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
What is self-preservation mode in Eureka and when does it activate?
Q02SENIOR
How does a Eureka client discover service instances, and what happens wh...
Q03JUNIOR
What is the difference between lease-renewal-interval-in-seconds and lea...
Q04SENIOR
How do you implement zone-aware routing with Eureka?
Q05JUNIOR
Why does a Eureka client need to use @EnableDiscoveryClient when the aut...
Q06SENIOR
How would you implement a graceful shutdown sequence for a Eureka-regist...
Q07SENIOR
What is the thundering herd problem with Eureka and how do you mitigate ...
Q08SENIOR
How does enabling eureka.client.healthcheck.enabled=true change instance...
Q01 of 08SENIOR

What is self-preservation mode in Eureka and when does it activate?

ANSWER
Self-preservation mode activates when the Eureka server receives fewer heartbeats than 85% of the expected rate in the last minute. When active, the server stops evicting any instances, even those whose leases have expired. This protects against false de-registrations during network partitions between the server and clients. It does not protect against de-registrations that happen via explicit API calls (graceful shutdown).
FAQ · 6 QUESTIONS

Frequently Asked Questions

01
Do I still need Eureka if I'm running on Kubernetes?
02
Can I use Eureka with Spring Boot 3.x?
03
How long does it take for a new service instance to start receiving traffic after registration?
04
What's the difference between @EnableEurekaServer and @EnableDiscoveryClient?
05
How do I configure Eureka for local development without a running server?
06
How does Eureka handle multiple instances of the same service?
🔥

That's Spring Cloud. Mark it forged?

8 min read · try the examples if you haven't

Previous
Role-Based Access Control with Spring Security
1 / 8 · Spring Cloud
Next
API Gateway with Spring Cloud Gateway