Skip to content

Commit 1699939

Browse files
committed
DOC-3222 RS: Clarified formula and examples for disk sizing for heavy write scenarios
1 parent 620bee5 commit 1699939

File tree

1 file changed

+124
-28
lines changed

1 file changed

+124
-28
lines changed

content/operate/rs/clusters/optimize/disk-sizing-heavy-write-scenarios.md

Lines changed: 124 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,127 @@ description: Sizing considerations for persistent disk space for heavy throughpu
1010
linktitle: Disk sizing
1111
weight: $weight
1212
---
13-
In extreme write scenarios, when AOF is enabled, the AOF rewrite process
14-
may require considerably more disk space for database persistence.
15-
16-
To estimate the required persistent disk space in such cases, use the
17-
formula described below.
18-
19-
**The required persistent disk space for AOF rewrite purposes in extreme
20-
write scenarios, assuming identical shard sizes:**
21-
22-
**X (1 + 3Y +Y²)**
23-
where:
24-
**X** = each shard size
25-
**Y** = number of shards
26-
27-
Following are examples of database configurations and the persistence
28-
disk space they would require in this scenario:
29-
30-
| | Example 1 | Example 2 | Example 3 | Example 4 |
31-
|---|------------|-----------------|------------|-----------------|
32-
| Database size (GB) | 10 | 10 | 40 | 40 |
33-
| Number of shards | 4 | 16 | 5 | 15 |
34-
| Shard size (GB) | 2.5 | 0.625 | 8 | 2.67 |
35-
| Required disk space (GB) | 73 | 191 | 328 | 723 |
36-
37-
For disk size requirements in standard usage scenarios, refer to the
38-
[Hardware
39-
requirements]({{< relref "/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements.md" >}})
40-
section.
13+
In extreme write scenarios when append-only files (AOF) are enabled, the AOF rewrite process can require considerably more disk space for [database persistence]({{<relref "/operate/rs/databases/configure/database-persistence/">}}).
14+
15+
For disk size requirements for standard usage, see [Hardware requirements]({{< relref "/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements" >}}).
16+
17+
## Estimate required disk space
18+
19+
To estimate the required persistent disk space for AOF rewrite purposes in extreme write scenarios, use the following formula:
20+
21+
**X (1 + 3Y + Y²)**
22+
23+
Where:
24+
- **X** = size of each shard in GB
25+
- **Y** = number of shards
26+
27+
28+
## Examples
29+
30+
The following examples show how to calculate the persistent disk space required for heavy write scenarios for different database configurations, where:
31+
32+
- **Database size** is the memory limit configured for the database.
33+
34+
- **Number of shards** is the total number of shards (primary shards + replica shards).
35+
36+
### Example 1
37+
38+
- Database size = 10 GB
39+
- Number of shards = 4
40+
41+
1. Calculate the shard size:
42+
43+
```sh
44+
Shard size = database size / number of shards
45+
= 10 GB / 4 shards
46+
= 2.5 GB per shard
47+
```
48+
49+
1. Use the formula to calculate the required persistent disk space:
50+
51+
```sh
52+
Disk space = X (1 + 3Y + Y²)
53+
= 2.5 (1 + 3 × 4 + 4²)
54+
= 2.5 (1 + 12 + 16)
55+
= 2.5 × 29
56+
= 72.5 GB
57+
```
58+
59+
1. Round up to 73 GB of required disk space.
60+
61+
### Example 2
62+
63+
- Database size = 10 GB
64+
- Number of shards = 16
65+
66+
1. Calculate the shard size:
67+
68+
```sh
69+
Shard size = database size / number of shards
70+
= 10 GB / 16 shards
71+
= 0.625 GB per shard
72+
```
73+
74+
1. Use the formula to calculate the required persistent disk space:
75+
76+
```sh
77+
Disk space = X (1 + 3Y + Y²)
78+
= 0.625 (1 + 3 × 16 + 16²)
79+
= 0.625 (1 + 48 + 256)
80+
= 0.625 × 305
81+
= 190.625 GB
82+
```
83+
84+
1. Round up to 191 GB of required disk space.
85+
86+
### Example 3
87+
88+
- Database size = 40 GB
89+
- Number of shards = 5
90+
91+
1. Calculate the shard size:
92+
93+
```sh
94+
Shard size = database size / number of shards
95+
= 40 GB / 5 shards
96+
= 8 GB per shard
97+
```
98+
99+
1. Use the formula to calculate the required persistent disk space:
100+
101+
```sh
102+
Disk space = X (1 + 3Y + Y²)
103+
= 8 (1 + 3 × 5 + 5²)
104+
= 8 (1 + 15 + 25)
105+
= 8 × 41
106+
= 328 GB
107+
```
108+
109+
1. Required disk space: 328 GB.
110+
111+
### Example 4
112+
113+
- Database size = 40 GB
114+
- Number of shards = 15
115+
116+
1. Calculate the shard size:
117+
118+
```sh
119+
Shard size = database size / number of shards
120+
= 40 GB / 15 shards
121+
= 2.67 GB per shard
122+
```
123+
124+
1. Use the formula to calculate the required persistent disk space:
125+
126+
```sh
127+
Disk space = X (1 + 3Y + Y²)
128+
= 2.67 (1 + 3 × 15 + 15²)
129+
= 2.67 (1 + 45 + 225)
130+
= 2.67 × 271
131+
= 723.57 GB
132+
```
133+
134+
1. Round up to 724 GB of required disk space.
135+
136+

0 commit comments

Comments
 (0)