Skip to content

Commit 0d27a7f

Browse files
committed
Merge branch 'docs/cost'
2 parents f7b1e64 + 8212066 commit 0d27a7f

File tree

4 files changed

+380
-0
lines changed

4 files changed

+380
-0
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Leios Node Operating Costs Analysis
2+
3+
## Overview
4+
5+
This document provides a comprehensive analysis of the costs associated with running a Leios node.
6+
7+
## Cost Items
8+
9+
| Cost Item | Unit | Description |
10+
|-----------|------|-------------|
11+
| Compute (vCPU) | $/vCPU/h | Cost per virtual CPU per hour |
12+
| Compute (RAM) | $/GB/h | Cost per gigabyte of RAM per hour |
13+
| Storage (SSD) | $/GiB/mo | Cost per gibibyte of SSD storage per month |
14+
| Egress | $/GiB | Cost per gibibyte of data transferred out |
15+
| Ingress | $/GiB | Cost per gibibyte of data transferred in (if applicable) |
16+
17+
> [!Note]
18+
> Storage and data transfer use binary prefixes (GiB = 2³⁰ bytes), while RAM uses decimal prefixes (GB = 10⁹ bytes), following industry standards for cloud computing.
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
## Total Cost Analysis
52+
53+
This section provides a consolidated view of the three major cost components (vCPU, storage, and egress) for running a Leios node across different IB/s rates.
54+
55+
> [!Important]
56+
> Storage costs accumulate over time as blockchain data grows. The monthly view below shows only the incremental storage cost for that month, while the yearly view accounts for the total accumulated storage costs.
57+
58+
### Monthly Total Cost by Cloud Provider ($)
59+
60+
| Provider | IB/s | vCPU | Storage | Egress | Total | Notes |
61+
|------------|------|------|---------|---------|-------|-------|
62+
| AWS | 1 | $124.10 | $4.72 | $172.80 | $301.62 | c6i, US East |
63+
| | 5 | $248.20 | $22.84 | $816.30 | $1,087.34 | |
64+
| | 10 | $496.40 | $45.50 | $1,625.40| $2,167.30 | |
65+
| | 20 | $992.80 | $90.82 | $3,243.60| $4,327.22 | |
66+
| | 30 | $1,985.60| $136.13 | $4,862.70| $6,984.43 | |
67+
| GCP | 1 | $152.35 | $2.36 | $230.40 | $385.11 | c2/n2, US Central1 |
68+
| | 5 | $304.78 | $11.42 | $1,088.40| $1,404.60 | |
69+
| | 10 | $609.48 | $22.75 | $2,167.20| $2,799.43 | |
70+
| | 20 | $1,219.04| $45.41 | $4,325.40| $5,589.85 | |
71+
| | 30 | $2,437.92| $68.07 | $6,483.60| $8,989.59 | |
72+
| Azure | 1 | $123.37 | $4.42 | $167.04 | $294.83 | Fsv2, East US |
73+
| | 5 | $246.74 | $21.42 | $788.73 | $1,056.89 | |
74+
| | 10 | $494.21 | $42.66 | $1,570.89| $2,107.76 | |
75+
| | 20 | $988.42 | $85.14 | $3,135.09| $4,208.65 | |
76+
| | 30 | $1,976.84| $127.63 | $4,699.29| $6,803.76 | |
77+
| DigitalOcean| 1 | $84.00 | $5.90 | $19.20 | $109.10 | CPU-Optimized |
78+
| | 5 | $168.00 | $28.55 | $90.70 | $287.25 | |
79+
| | 10 | $336.00 | $56.88 | $180.60 | $573.48 | |
80+
| | 20 | $672.00 | $113.52 | $360.40 | $1,145.92| |
81+
| | 30 | $1,344.00| $170.17 | $540.30 | $2,054.47| |
82+
| Hetzner | 1 | $17.80 | $2.71 | $2.07 | $22.58 | CPX |
83+
| | 5 | $32.90 | $13.13 | $9.80 | $55.83 | |
84+
| | 10 | $65.30 | $26.16 | $19.50 | $110.96| |
85+
| | 20 | $130.60 | $52.22 | $38.92 | $221.74| |
86+
| | 30 | $261.20 | $78.28 | $58.35 | $397.83| |
87+
88+
### Yearly Total Cost by Cloud Provider ($)
89+
90+
| Provider | IB/s | vCPU | Storage | Egress | Total | Notes |
91+
|------------|------|------|---------|---------|-------|-------|
92+
| AWS | 1 | $1,489.20 | $56.64 | $2,073.60 | $3,619.44 | c6i, US East |
93+
| | 5 | $2,978.40 | $274.08 | $9,795.60 | $13,048.08 | |
94+
| | 10 | $5,956.80 | $546.00 | $19,504.80| $26,007.60 | |
95+
| | 20 | $11,913.60| $1,089.84| $38,923.20| $51,926.64 | |
96+
| | 30 | $23,827.20| $1,633.56| $58,352.40| $83,813.16 | |
97+
| GCP | 1 | $1,828.20 | $28.32 | $2,764.80 | $4,621.32 | c2/n2, US Central1 |
98+
| | 5 | $3,657.36 | $137.04 | $13,060.80| $16,855.20 | |
99+
| | 10 | $7,313.76 | $273.00 | $26,006.40| $33,593.16 | |
100+
| | 20 | $14,628.48| $544.92 | $51,904.80| $67,078.20 | |
101+
| | 30 | $29,255.04| $816.84 | $77,803.20| $107,875.08| |
102+
| Azure | 1 | $1,480.44 | $53.04 | $2,004.48 | $3,537.96 | Fsv2, East US |
103+
| | 5 | $2,960.88 | $257.04 | $9,464.76 | $12,682.68 | |
104+
| | 10 | $5,930.52 | $511.92 | $18,850.68| $25,293.12 | |
105+
| | 20 | $11,861.04| $1,021.68| $37,621.08| $50,503.80 | |
106+
| | 30 | $23,722.08| $1,531.56| $56,391.48| $81,645.12 | |
107+
| DigitalOcean| 1 | $1,008.00 | $70.80 | $230.40 | $1,309.20 | CPU-Optimized |
108+
| | 5 | $2,016.00 | $342.60 | $1,088.40 | $3,447.00 | |
109+
| | 10 | $4,032.00 | $682.56 | $2,167.20 | $6,881.76 | |
110+
| | 20 | $8,064.00 | $1,362.24| $4,324.80 | $13,751.04| |
111+
| | 30 | $16,128.00| $2,042.04| $6,483.60 | $24,653.64| |
112+
| Hetzner | 1 | $213.60 | $32.52 | $24.84 | $270.96 | CPX |
113+
| | 5 | $394.80 | $157.56 | $117.60 | $669.96 | |
114+
| | 10 | $783.60 | $313.92 | $234.00 | $1,331.52| |
115+
| | 20 | $1,567.20 | $626.64 | $467.04 | $2,660.88| |
116+
| | 30 | $3,134.40 | $939.36 | $700.20 | $4,773.96| |
117+
118+
> [!Note]
119+
> - Costs are based on on-demand pricing in US regions
120+
> - vCPU costs assume compute-optimized instances
121+
> - Storage costs include both chain state and ledger state, accumulating over time
122+
> - Egress costs assume 20 peers with 100% header propagation and 25% body requests
123+
> - Total costs may be reduced through:
124+
> - Reserved instances or longer-term commitments
125+
> - Volume discounts
126+
> - Regional pricing variations
127+
> - Spot/preemptible instances where available
128+
129+
### Cost Breakdown by Component (%)
130+
131+
#### Monthly
132+
| IB/s | vCPU | Storage | Egress |
133+
|------|------|---------|---------|
134+
| 1 | 41% | 2% | 57% |
135+
| 5 | 23% | 2% | 75% |
136+
| 10 | 23% | 2% | 75% |
137+
| 20 | 23% | 2% | 75% |
138+
| 30 | 28% | 2% | 70% |
139+
140+
#### Yearly
141+
| IB/s | vCPU | Storage | Egress |
142+
|------|------|---------|---------|
143+
| 1 | 41% | 2% | 57% |
144+
| 5 | 23% | 2% | 75% |
145+
| 10 | 22% | 2% | 76% |
146+
| 20 | 23% | 2% | 75% |
147+
| 30 | 28% | 2% | 70% |
148+
149+
> [!Note]
150+
> - Percentages are averages across all providers
151+
> - Egress remains the dominant cost component
152+
> - Storage costs remain relatively small even when accumulated over a year
153+
> - vCPU costs become more significant at higher IB/s rates
154+
> - Hetzner's significantly lower costs are primarily due to their competitive egress pricing
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Compute (CPU) cost estimation per node
2+
3+
> [!Note]
4+
> This analysis assumes fully utilized block space for conservative upper bound estimation, similar to the egress analysis. We'll calculate CPU requirements at different IB/s rates.
5+
6+
## Base Parameters
7+
- Stage length: 20 slots (1 second per slot)
8+
- EBs per stage: 1.5 (average)
9+
- RBs per stage: 1
10+
- Average tx size: 1,400 bytes (from mainnet data)
11+
- IB body max size: 98,304 bytes (96 KiB)
12+
- Transactions per IB: ~70 (98,304/1,400)
13+
14+
## CPU Time Calculation per Second (1 IB/s scenario)
15+
16+
### Input Block Processing
17+
- IB Header validation: 1ms × 1 IB = 1ms
18+
- IB Body validation: (50ms + 98,304×0.0005ms) × 1 IB = 99.15ms
19+
- Transaction validation: 1.5ms × 70 txs = 105ms
20+
Subtotal: 205.15ms
21+
22+
### Endorser Block Processing (1.5 EBs per stage)
23+
- EB validation: 1ms × 1.5 EBs/20s = 0.075ms
24+
Subtotal: 0.075ms
25+
26+
### Vote Processing (500 votes per stage)
27+
- Vote validation: 0.816ms × 500 votes/20s = 20.4ms
28+
Subtotal: 20.4ms
29+
30+
### Certificate Processing (1 per stage)
31+
- Certificate validation: 130ms/20s = 6.5ms
32+
Subtotal: 6.5ms
33+
34+
Total CPU time per second: ~232ms (23.2% of one CPU core)
35+
36+
## CPU Utilization at Different IB Rates
37+
38+
| IB/s | CPU Time/s | Min Cores Needed | Recommended Cores |
39+
|------|------------|------------------|-------------------|
40+
| 1 | 232ms | 1 | 2 |
41+
| 5 | 1,160ms | 2 | 4 |
42+
| 10 | 2,320ms | 3 | 6 |
43+
| 20 | 4,640ms | 5 | 8 |
44+
| 30 | 6,960ms | 7 | 16 |
45+
46+
> [!Note]
47+
> - "Min Cores Needed" is calculated by dividing total CPU time by 1000ms and rounding up
48+
> - "Recommended Cores" adds redundancy for spikes and other node operations
49+
> - This assumes even distribution of work and perfect parallelization, which is optimistic
50+
51+
## Monthly Cost by Cloud Provider ($)
52+
53+
Using standard compute-optimized instances:
54+
55+
| Provider | 2 Core | 4 Core | 8 Core | 16 Core | Notes |
56+
|------------|--------|--------|--------|---------|-------|
57+
| AWS c6i | $62.05 | $124.10| $248.20| $496.40 | On-demand, US East |
58+
| GCP c2/n2 | $52.34 | $152.35| $304.78| $609.48 | On-demand, US Central1, 2-core uses n2-highcpu-2 |
59+
| Azure Fsv2 | $61.76 | $123.37| $246.74| $494.21 | On-demand, East US |
60+
| DO CPU-Opt | $42.00 | $84.00 | $168.00| $336.00 | Regular pricing |
61+
| Linode | $36.00 | $60.00 | $120.00| $240.00 | Standard pricing |
62+
| Hetzner | $5.40 | $17.80 | $32.90 | $65.30 | Standard pricing |
63+
64+
> [!Note]
65+
> - Prices are for US regions and may vary by location
66+
> - Assumes dedicated compute-optimized instances
67+
> - Does not include potential savings from reserved instances or spot pricing
68+
> - Memory requirements not considered (typically sufficient in compute-optimized instances)
69+
70+
## Recommendations
71+
72+
1. For 1-5 IB/s: 4 cores should be sufficient ($60-$152/month)
73+
2. For 5-15 IB/s: 8 cores recommended ($120-$305/month)
74+
3. For 15-30 IB/s: 16 cores recommended ($240-$609/month)
75+
4. Above 30 IB/s: Consider multiple nodes or higher-end instances
76+
77+
Key considerations:
78+
- These calculations assume perfect parallelization which is optimistic
79+
- Real-world performance may require more cores due to:
80+
- Network stack overhead
81+
- OS operations
82+
- Uneven workload distribution
83+
- Memory bandwidth limitations
84+
- Other node operations not included in calculation
85+
86+
## Compute Cost Sources
87+
88+
| Provider | Instance Type | Source | Last Updated |
89+
|----------|--------------|---------|--------------|
90+
| AWS | c6i | https://aws.amazon.com/ec2/pricing/on-demand/ | Apr 2025 |
91+
| GCP | c2/n2 | https://cloud.google.com/compute/vm-instance-pricing | Apr 2025 |
92+
| Azure | Fsv2 | https://azure.microsoft.com/pricing/details/virtual-machines/series/ | Apr 2025 |
93+
| DigitalOcean | CPU-Optimized | https://www.digitalocean.com/pricing/compute | Apr 2025 |
94+
| Linode | Dedicated CPU | https://www.linode.com/pricing/ | Apr 2025 |
95+
| Hetzner | CPX | https://www.hetzner.com/cloud/pricing | Apr 2025 |
96+
97+
Note: Prices shown are for US regions and may vary by location. Many providers offer significant discounts for reserved instances or longer-term commitments. The table shows standard on-demand rates for compute-optimized instances.

docs/cost-estimate/04-storage.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Storage cost estimation per node
2+
3+
> [!Note]
4+
> **100% filled blocks assumption:**
5+
>
6+
> This analysis assumes fully utilized block space for both Ouroboros Praos and Leios protocols, similar to the egress analysis. We'll calculate storage requirements at different IB/s rates.
7+
8+
## Praos Baseline Storage
9+
Current Praos storage requirements per node:
10+
- Block size: 88,908 bytes (87,884 body + 1,024 header)
11+
- Block frequency: 0.05 blocks/slot
12+
- Slots per month: 2,592,000 (30 days * 86,400 slots/day)
13+
- Total blocks: 129,600 (0.05 * 2,592,000)
14+
- Raw storage: 129,600 * 88,908 = 11.52 GiB/month
15+
- Compressed (79%): 2.42 GiB/month
16+
17+
## Leios Storage Components
18+
19+
### Base Parameters
20+
21+
### Block Sizes
22+
- Input Block (IB): 98,304 bytes (96 KiB)
23+
- Endorsement Block (EB): 32 bytes per IB reference
24+
- Ranking Block (RB): 90,112 bytes (88 KiB)
25+
- Average transaction size: 1,400 bytes (from mainnet data)
26+
- Transactions per IB: ~70 (98,304/1,400)
27+
28+
### Time Parameters
29+
- Seconds per month: 2,592,000 (30 days)
30+
- Stage length: 20 slots
31+
- EBs per stage: 1.5
32+
- RBs per stage: 1 (every 20 slots)
33+
34+
## Storage Components
35+
36+
### 1. Ledger State (UTXO Set)
37+
- Base ledger size: 200 GB (current Cardano mainnet)
38+
- Growth rate depends on transaction volume
39+
- Compression ratio: ~79% (based on historical data)
40+
41+
### 2. Chain State (Transaction History)
42+
43+
#### Input Blocks (IB)
44+
- Header: 304 bytes
45+
- Body: 98,304 bytes
46+
- Total per IB: 98,608 bytes
47+
48+
#### Endorsement Blocks (EB)
49+
- Header: 240 bytes
50+
- Body: 32 bytes per IB reference
51+
- Total per EB: 240 + (32 × number of IB references)
52+
53+
#### Votes
54+
- Size: 150 bytes per vote
55+
- Votes per pipeline: 600
56+
- Votes per EB: 900 (600 × 1.5 EBs)
57+
58+
#### Ranking Blocks (RB)
59+
- Header: 1,024 bytes
60+
- Body: 90,112 bytes
61+
- Total per RB: 91,136 bytes
62+
63+
## Monthly Storage Analysis
64+
65+
### Example Calculation (1 IB/s)
66+
```
67+
IB Storage: 2,592,000 seconds × 98,608 bytes = 244.31 GiB
68+
EB Storage: 2,592,000 seconds × (240 + 32) bytes × 1.5 EBs = 1.05 GiB
69+
Vote Storage: 194,400 seconds × 150 bytes × 900 votes = 24.38 GiB
70+
RB Storage: 129,600 seconds × 91,136 bytes = 11.02 GiB
71+
Total Raw: 280.76 GiB
72+
Compressed (79%): 58.96 GiB
73+
```
74+
75+
### Monthly Storage per Node
76+
77+
| IB/s | Chain State Raw | Chain State Compressed (79%) | Ledger State | Total Storage | vs Praos (11.52 GiB) |
78+
|------|----------------|----------------------------|--------------|---------------|---------------------|
79+
| 1 | 280.76 GiB | 58.96 GiB | 200 GiB | 258.96 GiB | +2,337% |
80+
| 5 | 1,359.72 GiB | 285.54 GiB | 200 GiB | 485.54 GiB | +4,114% |
81+
| 10 | 2,708.42 GiB | 568.77 GiB | 200 GiB | 768.77 GiB | +6,572% |
82+
| 20 | 5,405.82 GiB | 1,135.22 GiB | 200 GiB | 1,335.22 GiB | +11,490% |
83+
| 30 | 8,103.22 GiB | 1,701.68 GiB | 200 GiB | 1,901.68 GiB | +16,408% |
84+
85+
> [!Note]
86+
> - Percentage increases are calculated against uncompressed Praos baseline of 11.52 GiB/month
87+
> - While Leios chain state can potentially be compressed (shown in the "Chain State Compressed" column), current Cardano nodes do not compress chain state
88+
> - Compression ratio of 79% is based on research findings from the technical report using xz -9 compression on historical mainnet data
89+
> - Actual compression ratios may vary for future blocks and transactions
90+
91+
## Cost Analysis
92+
93+
### Monthly Cost by Cloud Provider ($)
94+
95+
| Provider | Price/GB | Free Allowance (GB) | 1 IB/s (58.96 GB) | 5 IB/s (285.54 GB) | 10 IB/s (568.77 GB) | 20 IB/s (1,135.22 GB) | 30 IB/s (1,701.68 GB) |
96+
|------------------|----------|---------------------|-------------------|--------------------|---------------------|-----------------------|-----------------------|
97+
| Google Cloud | $0.040 | 0 | $2.36 | $11.42 | $22.75 | $45.41 | $68.07 |
98+
| Railway | $0.150 | 0 | $8.84 | $42.83 | $85.32 | $170.28 | $255.25 |
99+
| AWS | $0.080 | 100 | $4.72 | $22.84 | $45.50 | $90.82 | $136.13 |
100+
| Microsoft Azure | $0.075 | 100 | $4.42 | $21.42 | $42.66 | $85.14 | $127.63 |
101+
| Alibaba Cloud | $0.050 | 10 | $2.95 | $14.28 | $28.44 | $56.76 | $85.08 |
102+
| DigitalOcean | $0.100 | 100–10,000 | $5.90 | $28.55 | $56.88 | $113.52 | $170.17 |
103+
| Oracle Cloud | $0.0425 | 10,240 | $2.51 | $12.14 | $24.17 | $48.25 | $72.32 |
104+
| Linode | $0.100 | 1,024–20,480 | $5.90 | $28.55 | $56.88 | $113.52 | $170.17 |
105+
| Hetzner | $0.046 | 0 | $2.71 | $13.13 | $26.16 | $52.22 | $78.28 |
106+
| UpCloud | $0.056 | 1,024–24,576 | $3.30 | $15.99 | $31.85 | $63.57 | $95.29 |
107+
108+
### Notes
109+
- **Compressed Storage Sizes**: 1 IB/s = 58.96 GB, 5 IB/s = 285.54 GB, 10 IB/s = 568.77 GB, 20 IB/s = 1,135.22 GB, 30 IB/s = 1,701.68 GB
110+
- **Pricing Sources**: Updated from official provider websites as of April 1, 2025 (e.g., Hetzner at $0.046/GB from €0.044/GB at €1 = $1.05)
111+
- **Free Allowances**: Listed for reference but not applied to reduce costs in this table
112+
- **Currency**: All costs in USD, with Hetzner converted from euros using an estimated exchange rate of €1 = $1.05
113+
114+
## Storage Cost Sources
115+
116+
| Provider | Price/GB | Source | Last Updated |
117+
|----------|----------|---------|--------------|
118+
| Google Cloud | $0.040 | https://cloud.google.com/compute/disks-image-pricing | Feb 2025 |
119+
| Railway | $0.150 | https://railway.app/pricing | - |
120+
| AWS | $0.080 | https://aws.amazon.com/ebs/pricing/ | 2023 |
121+
| Microsoft Azure | $0.075 | https://azure.microsoft.com/pricing/details/managed-disks/ | Dec 2024 |
122+
| Alibaba Cloud | $0.050 | https://www.alibabacloud.com/pricing | 2024 |
123+
| DigitalOcean | $0.100 | https://www.digitalocean.com/pricing/ | - |
124+
| Oracle Cloud | $0.0425 | https://www.oracle.com/cloud/pricing/ | Dec 2024 |
125+
| Linode | $0.100 | https://www.linode.com/pricing/ | Apr 2023 |
126+
| Hetzner | $0.046 | https://www.hetzner.com/cloud/pricing | 2024 |
127+
| UpCloud | $0.056 | https://upcloud.com/pricing/ | - |
128+
129+
Note: Prices may vary by region and volume. Some providers offer free tiers or volume discounts not reflected in these base rates. The table shows the standard storage rates for the most commonly used regions.
File renamed without changes.

0 commit comments

Comments
 (0)