content/operate/rs/7.22/clusters/optimize/disk-sizing-heavy-write-scenarios.md
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/7.22/databases/configure/database-persistence/">}}).
For disk size requirements for standard usage, see [Hardware requirements]({{< relref "/operate/rs/7.22/installing-upgrading/install/plan-deployment/hardware-requirements" >}}).
To estimate the required persistent disk space for AOF rewrite purposes in extreme write scenarios, use the following formula:
X (1 + 3Y + Y²)
Where:
The following examples show how to calculate the persistent disk space required for heavy write scenarios for different database configurations, where:
Database size is the memory limit configured for the database.
Number of shards is the total number of shards (primary shards + replica shards).
Calculate the shard size:
Shard size = database size / number of shards
= 10 GB / 4 shards
= 2.5 GB per shard
Use the formula to calculate the required persistent disk space:
Disk space = X (1 + 3Y + Y²)
= 2.5 (1 + 3 × 4 + 4²)
= 2.5 (1 + 12 + 16)
= 2.5 × 29
= 72.5 GB
Round up to 73 GB of required disk space.
Calculate the shard size:
Shard size = database size / number of shards
= 10 GB / 16 shards
= 0.625 GB per shard
Use the formula to calculate the required persistent disk space:
Disk space = X (1 + 3Y + Y²)
= 0.625 (1 + 3 × 16 + 16²)
= 0.625 (1 + 48 + 256)
= 0.625 × 305
= 190.625 GB
Round up to 191 GB of required disk space.
Calculate the shard size:
Shard size = database size / number of shards
= 40 GB / 5 shards
= 8 GB per shard
Use the formula to calculate the required persistent disk space:
Disk space = X (1 + 3Y + Y²)
= 8 (1 + 3 × 5 + 5²)
= 8 (1 + 15 + 25)
= 8 × 41
= 328 GB
Required disk space: 328 GB.
Calculate the shard size:
Shard size = database size / number of shards
= 40 GB / 15 shards
= 2.67 GB per shard
Use the formula to calculate the required persistent disk space:
Disk space = X (1 + 3Y + Y²)
= 2.67 (1 + 3 × 15 + 15²)
= 2.67 (1 + 45 + 225)
= 2.67 × 271
= 723.57 GB
Round up to 724 GB of required disk space.