The Graph Indexer in AWS Cloud - Costs

We can run The Graph Indexer in a different ways. One of them can be a Public Cloud Provider like Amazon Web Services.

Description

  1. We run The Graph Indexer in AWS
  2. We use Kubernetes based on AWS EKS to manage all applications
  3. We run 4 Index node with ~ 5 subgraphs/node
  4. We run 3 Indexer services with autoscaling enabled to handle traffic spikes
  5. We run 2 Query nodes with autoscaling enabled to handle traffic spikes
  6. We indexing for about 30 subgraphs simultaneously
  7. We use Amazon Aurora PostgreSQL to store graph DB and its size is ~ 2 TB
  8. We use 2 Erigon nodes with EBS volumes and behind ALB for high availability and traffic balancing
  9. We use Fluent Bit to send all the logs from Kubernetes for OpenSearch
  10. We use Amazon OpenSearch to send alarms on errors from the application logs
  11. We use Amazon CloudWatch to send alarms for Amazon resources

AWS Services and costs

A list of Amazon Web Services and their costs to run Indexer in AWS Cloud can be the following

# AWS Service Purpose Usage Cost, USD/m
1 Amazon Route 53 DNS zone 1 Zone, 1 mln/m standard queries 0.90
2 Amazon Virtual Private Cloud) Networking 1 NAT Gw, Data 1 TB/m, AZ 15 TB/m, Out 1 TB/m 478.29
3 Amazon Application Load Balancer Kubernetes Ingress, Erigon LB 2 ALB, 200 c/s, 200 r/s 126.29
4 Amazon Certificate Manager ALB SSL certificate 1 Cert 0.00
5 Amazon Elastic Kubernetes Service Kubernetes Cluster 1 EKS Cluster 73.00
6 Amazon Aurora PostgreSQL DB 1 db.r6g.2xlarge, Single-AZ, 2 TB, 20 mln/h IOPS 3,882.54
7 Amazon OpenSearch Service OpenSearch 3 m5.large.search, 200 GiB GP2 391.98
8 Amazon Web Application Firewall Web Application Firewall 1 ACL, 3 rules, 10 mln requests 14.00
9 Amazon EC2 Kubernetes Cluster nodes 3 r6g.xlarge, 30 GiB GP3 3 x 149.57
Erigon node 2 c6i.4xlarge, 30 GiB GP3 2 x 498.80
10 Amazon Elastic Block Store Erigon node disk 2 EBS 3000 GiB/ GP3/16000 IOPS/ 1000 MiB/s 2 x 340.00
11 Amazon Secrets Manager EC2 instances secrets 1 secret 0.40
12 Amazon Cognito OpenSearch authentication 100 MAUs 0.00
13 Amazon CloudWatch Metrics, alarms 100 Metrics, 20 Standard alarms, 10 GB ingested 37.05
14 Amazon IAM Roles, policies Roles, policies, identity providers 0.00
TOTAL 7130.76

Note: All costs calculated for Ohio region and for On-Demand Instances

You can access estimate calculated in AWS Pricing Calculator via following link - The Graph Indexer - AWS Cloud (Public share links expire after 3 years).

The Graph Indexer - AWS Cloud

Costs changes

Resulting cost may change mainly because of the following

  1. Network in/out data processed in VPC
  2. Network traffic processed by ALB
  3. PostgreSQL DB size and IOPS
  4. PostgreSQL DB snapshots
  5. Erigon nodes EBS volumes size snapshots

Costs optimizations

We can consider the following to optimize costs

  1. Use Amazon Aurora Serverless v2 with tunned autoscaling to optimize DB resources usage.
  2. Consider to use Reserved instances.
  3. Consider to use Erigon LB inside Kubernetes Cluster if you don’t need access to nodes from external resources.

Known issues

  1. Erigon nodes initial sync on EBS is very slow and may take up to 20 days
4 Likes

This is very useful. Thanks a lot! Cc @Pedro

3 Likes