Skip to content

EC2 Tier Recommendations

Server sizing guide for the GSign platform.

Memory Requirements

Full Infrastructure

ComponentMemory
GitLab CE4 GB
PostgreSQL512 MB
MongoDB512 MB
Redis256 MB
Prometheus512 MB
Grafana256 MB
Loki512 MB
Go Backend256 MB
Next.js Frontend256 MB
HSM Backend128 MB
Documentation64 MB
System (Ubuntu + NGINX)512 MB
Total~9.9 GB
SpecValue
vCPU2
RAM8 GB
NetworkModerate
Cost~$60/month

Best for:

  • Full infrastructure deployment
  • Comfortable headroom
  • Development + staging

t3.medium (Budget)

SpecValue
vCPU2
RAM4 GB
NetworkModerate
Cost~$30/month

Requires:

  • Disable GitLab Runner (saves 1 GB)
  • Use Loki instead of Elasticsearch
  • Remove database replicas
  • Reduce Prometheus retention

t3.xlarge (Performance)

SpecValue
vCPU4
RAM16 GB
NetworkHigh
Cost~$120/month

Best for:

  • Team development
  • High traffic staging
  • Additional services

AWS Lightsail Alternative

Lightsail 8 GB (Best Value)

SpecValue
vCPU2
RAM8 GB
SSD160 GB
Transfer4 TB
Cost$40/month

Benefits:

  • Fixed pricing (no surprises)
  • Same performance as t3.large
  • Simpler management
  • 4 TB transfer included

Cost Optimization

Spot Instances

Save up to 70% with spot instances:

InstanceOn-DemandSpot
t3.large$60/month~$18/month
t3.xlarge$120/month~$36/month

Risk: Instance can be interrupted (2-minute warning)

Use case: Development environments, batch processing

Reserved Instances

Save 40-60% with 1-3 year commitment:

TermDiscount
1 year, no upfront40%
1 year, all upfront45%
3 year, all upfront60%

Stop When Not in Use

Development server running 8 hours/day:

  • Regular: $60/month
  • 8 hours/day: ~$20/month

Weekend shutdown:

  • Regular: $60/month
  • Weekdays only: ~$45/month

Lightweight Setup (4 GB)

For t3.medium with 4 GB RAM:

Disable GitLab Runner

yaml
# Remove from docker-compose
# gitlab-runner: ...

Saves: 1 GB

Use Loki Instead of EFK

Already using Loki (lighter than Elasticsearch)

Saves: 3 GB (vs EFK stack)

Single Database Instances

No replicas:

  • PostgreSQL: 1 instance
  • MongoDB: 1 instance
  • Redis: 1 instance

Saves: 800 MB

Reduce Prometheus Retention

yaml
# prometheus.yml
--storage.tsdb.retention.time=7d  # from 30d

Saves: 200 MB

Result: 9.9 GB → ~5.2 GB (fits in 4 GB with swap)

Quick Decision Matrix

RequirementRecommendation
Full infrastructure, comfortt3.large ($60)
Budget developmentt3.medium ($30) + optimizations
Team developmentt3.xlarge ($120)
Best valueLightsail 8 GB ($40)
Production previewt3.large or Lightsail
CI/CD with buildst3.large minimum

Setup Commands

EC2 t3.large

bash
# Launch instance
aws ec2 run-instances \
  --instance-type t3.large \
  --image-id ami-0xxx \
  --key-name gsign-key \
  --security-group-ids sg-xxx \
  --block-device-mappings "[{\"DeviceName\":\"/dev/sda1\",\"Ebs\":{\"VolumeSize\":100}}]"

Lightsail

bash
# Create instance
aws lightsail create-instances \
  --instance-names gsign-dev \
  --availability-zone eu-north-1a \
  --blueprint-id ubuntu_24_04 \
  --bundle-id large_3_0

Monitoring Resources

bash
# Memory usage
free -h

# Disk usage
df -h

# Container resources
docker stats

# Top processes
htop

Disk Recommendations

EnvironmentSizeType
Development50 GBgp3
Staging100 GBgp3
Production200+ GBgp3

Note: GitLab + databases can grow quickly. Monitor disk usage.

GSign Digital Signature Platform