Skip to main content

Hardware Profiles

Hardware profiles are used to configure the hardware resources for the Cardano Rosetta Java application. They provide preconfigured sets of environment variables to optimize PostgreSQL and connection pooling based on different hardware capabilities.

Overview

Hardware profiles are implemented as environment files that are passed to Docker or Docker Compose when launching Cardano Rosetta Java services. The entrypoint script verifies these settings and configures PostgreSQL and application connection pools accordingly.

Available Hardware Profiles

Cardano Rosetta Java provides preconfigured hardware profiles to match different deployment scenarios:

Entry-Level Hardware Profile

Designed for development environments or smaller deployments with limited resources:

  • 4 CPU cores
  • 32 GB RAM
  • Suitable for development, testing, or light production use
tip

Choose the mid-level profile for production environments with moderate to high traffic.

Hardware Profile Configuration Parameters

Hardware profiles define two main sets of configuration parameters:

Profile Parameters Comparison

ParameterEntry-LevelMid-LevelPurpose
API_DB_POOL_MIN_COUNT12150Minimum database connections
API_DB_POOL_MAX_COUNT12150Maximum database connections
DB_POSTGRES_MAX_CONNECTIONS120300Maximum PostgreSQL connections
DB_POSTGRES_SHARED_BUFFERS1GB4GBMemory for data caching
DB_POSTGRES_EFFECTIVE_CACHE_SIZE2GB8GBEstimate of memory available for disk caching
DB_POSTGRES_WORK_MEM16MB64MBMemory for query operations
DB_POSTGRES_MAINTENANCE_WORK_MEM128MB512MBMemory for maintenance operations
DB_POSTGRES_WAL_BUFFERS16MB512MBMemory for write-ahead logging
DB_POSTGRES_MAX_PARALLEL_WORKERS48Maximum parallel query workers

How to Use Hardware Profiles

docker run --name rosetta -v {MOUNT_PATH}:/node \
--env-file ./docker/.env.dockerfile \
--env-file ./docker/.env.docker-profile-mid-level \
-p 8082:8082 --shm-size=4g -d cardanofoundation/cardano-rosetta-java:latest

Custom Hardware Profiles

You can create custom hardware profiles by:

  1. Copying an existing profile file, e.g., docker/.env.docker-profile-mid-level
  2. Modifying the parameters to match your hardware
  3. Using the custom profile file when launching with Docker or Docker Compose

When creating custom profiles, consider:

  • Maintain a healthy ratio between API_DB_POOL_*_COUNT and DB_POSTGRES_MAX_CONNECTIONS.
  • Adjust memory parameters (DB_POSTGRES_SHARED_BUFFERS, DB_POSTGRES_EFFECTIVE_CACHE_SIZE, DB_POSTGRES_WORK_MEM, etc.) based on your system's available RAM.
  • Set DB_POSTGRES_MAX_PARALLEL_WORKERS according to your CPU core count.
info

Hardware profiles help optimize PostgreSQL and connection pooling based on your available resources.