Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/en/blog/2023/how_to_debug_large_db_size_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ draft: false
# Background
Users can configure the quota of the backend db size using flag `--quota-backend-bytes`. It's the max number of bytes
the etcd db file may consume, namely the ${etcd-data-dir}/member/snap/db file. Its default value is 2GB, and the
suggested max value is 8GB.
suggested max value is 100GB.

2GB is usually sufficient for most use cases. If you run out of the db quota, you will see error message `etcdserver: mvcc: database space exceeded`
when trying to write more data, and see alarm "NOSPACE" (see example below) when checking the endpoint status or health state. It would be better to figure out whether it's expected. It's exactly the reason why I provide this guide.
Expand Down Expand Up @@ -248,8 +248,8 @@ to do the similar analysis(see example below). Note that you can build the binar
If the behavior (db size exceeds the quota) is expected, then you can set a bigger value for `--quota-backend-bytes`.
You need to make sure your cloud provider supports this, otherwise the manual update might not survive across cluster
upgrading or VM recreating. **Note that etcd (actually boltDB) maps the db file into memory directly, so a larger value
also means more memory usage**. Just I mentioned in the beginning of this post, the suggested max value is 8GB. Of course,
If your VM has big memory (e.g. 64GB), it's OK to set a value > 8GB.
also means more memory usage**. Just I mentioned in the beginning of this post, the suggested max value is 100GB. Of course,
If your VM has big memory (e.g. 64GB), it's OK to set a value > 100GB.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If your VM has big memory (e.g. 64GB), it's OK to set a value > 100GB.
If your VM has big memory (e.g. 128GB), it's OK to set a value > 100GB.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a smaller VM with 64GB RAM may good with 8GB database, but if your DB is 100 GB and your VM has only 64 GB RAM, it can drastically slow down operations. Just thought to suitable with the context of this doc, you should set larger VM RAM such as 128GB.


The other solution is to set per-resource etcd servers overrides using apiserver flag `--etcd-servers-overrides`.
In the following example, there are two etcd clusters; one for the normal usage, and the other dedicated to events.
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.1/dev-guide/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ etcd is designed to handle small key value pairs typical for metadata. Larger re

## Storage size limit

The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 8GB.
The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 100GB.
Copy link
Contributor

@wendy-ha18 wendy-ha18 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etcd v3.1.0 to v3.3.0 was released from 2017 to before May 2019. I believe the optimizations to boltDB to scale the boltDB beyond 8GBlimit only applied for version released after 2019. That means, IMHO, you only need to update docs for v3.5.0-v3.7.0.

We don't need to update older versions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd restrict that further, and only update 3.5 and up.


2 changes: 1 addition & 1 deletion content/en/docs/v3.1/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ title: Frequently Asked Questions (FAQ)

#### System requirements

Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a 2GB default storage size quota, configurable up to 8GB. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.
Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a 2GB default storage size quota, configurable up to 100GB. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.

Most stable production environment is Linux operating system with amd64 architecture; see [supported platform][supported-platform] for more.

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.1/op-guide/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Heavily loaded etcd deployments, serving thousands of clients or tens of thousan

## Memory

etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 8GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.
etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 100GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.


## Disks
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.2/dev-guide/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ etcd is designed to handle small key value pairs typical for metadata. Larger re

## Storage size limit

The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 8GB.
The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 100GB.

2 changes: 1 addition & 1 deletion content/en/docs/v3.2/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ title: Frequently Asked Questions (FAQ)

#### System requirements

Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a 2GB default storage size quota, configurable up to 8GB. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.
Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a 2GB default storage size quota, configurable up to 100GB. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.

Most stable production environment is Linux operating system with amd64 architecture; see [supported platform][supported-platform] for more.

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.2/op-guide/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Heavily loaded etcd deployments, serving thousands of clients or tens of thousan

## Memory

etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 8GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.
etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 100GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.


## Disks
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.3/dev-guide/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ etcd is designed to handle small key value pairs typical for metadata. Larger re

## Storage size limit

The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag. 8GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag. 100GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
2 changes: 1 addition & 1 deletion content/en/docs/v3.3/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A member's advertised peer URLs come from `--initial-advertise-peer-urls` on ini

### System requirements

Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a configurable storage size quota set to 2GB by default. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. 8GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.
Since etcd writes data to disk, SSD is highly recommended. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a configurable storage size quota set to 2GB by default. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. 100GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.

Most stable production environment is Linux operating system with amd64 architecture; see [supported platform][supported-platform] for more.

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.3/op-guide/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Heavily loaded etcd deployments, serving thousands of clients or tens of thousan

## Memory

etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 8GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.
etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 100GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.


## Disks
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.4/dev-guide/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ etcd is designed to handle small key value pairs typical for metadata. Larger re

## Storage size limit

The default storage size limit is 2 GiB, configurable with `--quota-backend-bytes` flag. 8 GiB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
The default storage size limit is 2 GB, configurable with `--quota-backend-bytes` flag. 100 GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. Read this [blog](https://www.cncf.io/blog/2019/05/09/performance-optimization-of-etcd-in-web-scale-data-scenario/) to further understand how the 100 GB was obtained.
5 changes: 2 additions & 3 deletions content/en/docs/v3.4/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A member's advertised peer URLs come from `--initial-advertise-peer-urls` on ini

### System requirements

Since etcd writes data to disk, its performance strongly depends on disk performance. For this reason, SSD is highly recommended. To assess whether a disk is fast enough for etcd, one possibility is using a disk benchmarking tool such as [fio][fio]. For an example on how to do that, read [here][fio-blog-post]. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a configurable storage size quota set to 2GB by default. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. 8GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.
Since etcd writes data to disk, its performance strongly depends on disk performance. For this reason, SSD is highly recommended. To assess whether a disk is fast enough for etcd, one possibility is using a disk benchmarking tool such as [fio][fio]. For an example on how to do that, read [this blog][fio-blog-post]. To prevent performance degradation or unintentionally overloading the key-value store, etcd enforces a configurable storage size quota set to 2GB by default. To avoid swapping or running out of memory, the machine should have at least as much RAM to cover the quota. 100GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. At CoreOS, an etcd cluster is usually deployed on dedicated CoreOS Container Linux machines with dual-core processors, 2GB of RAM, and 80GB of SSD *at the very least*. **Note that performance is intrinsically workload dependent; please test before production deployment**. See [hardware][hardware-setup] for more recommendations.

Most stable production environment is Linux operating system with amd64 architecture; see [supported platform][supported-platform] for more.

Expand Down Expand Up @@ -134,7 +134,7 @@ If none of the above suggestions clear the warnings, please [open an issue][new_

etcd uses a leader-based consensus protocol for consistent data replication and log execution. Cluster members elect a single leader, all other members become followers. The elected leader must periodically send heartbeats to its followers to maintain its leadership. Followers infer leader failure if no heartbeats are received within an election interval and trigger an election. If a leader doesn’t send its heartbeats in time but is still running, the election is spurious and likely caused by insufficient resources. To catch these soft failures, if the leader skips two heartbeat intervals, etcd will warn it failed to send a heartbeat on time.

Usually this issue is caused by a slow disk. Before the leader sends heartbeats attached with metadata, it may need to persist the metadata to disk. The disk could be experiencing contention among etcd and other applications, or the disk is too simply slow (e.g., a shared virtualized disk). To rule out a slow disk from causing this warning, monitor [wal_fsync_duration_seconds][wal_fsync_duration_seconds] (p99 duration should be less than 10ms) to confirm the disk is reasonably fast. If the disk is too slow, assigning a dedicated disk to etcd or using faster disk will typically solve the problem. To tell whether a disk is fast enough for etcd, a benchmarking tool such as [fio][fio] can be used. Read [here][fio-blog-post] for an example.
Usually this issue is caused by a slow disk. Before the leader sends heartbeats attached with metadata, it may need to persist the metadata to disk. The disk could be experiencing contention among etcd and other applications, or the disk is too simply slow (e.g., a shared virtualized disk). To rule out a slow disk from causing this warning, monitor [wal_fsync_duration_seconds][wal_fsync_duration_seconds] (p99 duration should be less than 10ms) to confirm the disk is reasonably fast. If the disk is too slow, assigning a dedicated disk to etcd or using faster disk will typically solve the problem. To tell whether a disk is fast enough for etcd, a benchmarking tool such as [fio][fio] can be used. Read [this blog][fio-blog-post] for an example.

The second most common cause is CPU starvation. If monitoring of the machine’s CPU usage shows heavy utilization, there may not be enough compute capacity for etcd. Moving etcd to dedicated machine, increasing process resource isolation with cgroups, or renicing the etcd server process into a higher priority can usually solve the problem.

Expand All @@ -146,7 +146,6 @@ If none of the above suggestions clear the warnings, please [open an issue][new_

etcd sends a snapshot of its complete key-value store to refresh slow followers and for [backups][backup]. Slow snapshot transfer times increase MTTR; if the cluster is ingesting data with high throughput, slow followers may livelock by needing a new snapshot before finishing receiving a snapshot. To catch slow snapshot performance, etcd warns when sending a snapshot takes more than thirty seconds and exceeds the expected transfer time for a 1Gbps connection.


[api-mvcc]: ../learning/api/#revisions
[backend_commit_metrics]: ../metrics/#disk
[backup]: /docs/v3.4/op-guide/recovery#snapshotting-the-keyspace
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.4/op-guide/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Heavily loaded etcd deployments, serving thousands of clients or tens of thousan

## Memory

etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 8GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.
etcd has a relatively small memory footprint but its performance still depends on having enough memory. An etcd server will aggressively cache key-value data and spends most of the rest of its memory tracking watchers. Typically 100GB is enough. For heavy deployments with thousands of watchers and millions of keys, allocate 16GB to 64GB memory accordingly.


## Disks
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/v3.5/dev-guide/limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ etcd is designed to handle small key value pairs typical for metadata. Larger re

## Storage size limit

The default storage size limit is 2 GiB, configurable with `--quota-backend-bytes` flag. 8 GiB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
The default storage size limit is 2 GiB, configurable with `--quota-backend-bytes` flag. 100GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. Read this [blog](https://www.cncf.io/blog/2019/05/09/performance-optimization-of-etcd-in-web-scale-data-scenario/) to further understand how the 100GB was obtained.
Loading