Resource Management and Performance Characteristics

← Back to SHAMap and NodeStore: Data Persistence and State Management


Introduction

Understanding SHAMap and NodeStore theoretically is one thing. Operating them in production is another.

This final chapter covers:

  • Real-world resource requirements

  • Performance measurement and optimization

  • Bottleneck identification

  • Tuning for different deployment scenarios

Lookup Complexity Analysis

SHAMap Lookup

Operation: Find account by ID

Worst case: O(64) node traversals
  Tree depth: 256 bits / 4 bits per level = 64 levels

Typical case: O(1)
  Most accounts found before depth 64
  Average depth in realistic ledger: ~25 levels

Expected time:
  Each traversal: O(1) array access (branch[0..15])
  Total: O(1) expected time (linear in actual tree size,
         but tree size ~ account count)

Cache hit: 1-10 microseconds
  Direct pointer access, no I/O

Cache miss: 1-10 milliseconds
  Database query required

Batch Fetch

Write Throughput

Ledger Close Cycle

Node Object Volume

Write Latency

Read Performance Characteristics

Cache Hit Scenario

Cache Miss Scenario

Memory Requirements

NodeStore Memory

SHAMap Memory

Total Memory Budget

Disk Space Requirements

Database Growth

With Rotation

Actual Sizes on Mainnet

File Descriptor Usage

File Descriptor Requirements

Performance Tuning

Identifying Bottlenecks

Monitor these metrics:

Tuning Parameters

Scenario 1: High-Traffic Validator

Scenario 2: Memory-Constrained

Scenario 3: Archive Node

Performance Characteristics Summary

Lookup Performance:

Write Performance:

Memory Usage:

Disk Space:

Scalability Limits:

Monitoring in Production

Key Metrics to Track

Alerting Thresholds

Last updated