Skip to main content
Skip to main content
🚧 Work in Progress

How Zerops scales Go

Zerops automatically scales your Go service based on actual usage. When your application needs more power, resources increase. When demand drops, resources scale down to reduce costs.

Read More

For complete scaling details across all services, see Automatic Scaling and High Availability.

How it works​

Vertical scaling adds more CPU, RAM, or disk space to existing containers. This approach is tried first because it's faster and more efficient.

Horizontal scaling creates entirely new containers when vertical scaling reaches its configured limits.

Read More

Learn more about vertical and horizontal scaling and complete technical details in our scaling guide.

Configure scaling​

You can configure scaling settings at different stages:

  • During service creation - Set initial scaling parameters when creating your Go service in the Zerops GUI.

  • During import - Define scaling configuration in your YAML import file using the verticalAutoscaling and horizontal scaling parameters. See Import & Export YAML Configuration for complete syntax.

  • After service creation - Navigate to your Go service and select Automatic scaling configuration from the menu to modify settings.

Basic settings​

Automatic Scaling

CPU mode: Choose between shared (cost-effective, variable performance) or dedicated (consistent performance, higher cost). You can change CPU mode once per hour. See pricing for costs or read more about CPU options.

Resource limits: Configure minimum and maximum resources for your Go service:

 MinimumMaximum
CPU cores18
RAM0.125 GB48 GB
Disk1 GB250 GB
  • Lower the maximum to control costs and prevent over-scaling
  • Raise the minimum when you need guaranteed baseline performance
  • Set minimum = maximum to disable automatic scaling for that specific resource
Read More

More details on fine-tuning resource allocation.

Container limits: Set how many containers your Go service can scale to:

Minimum containers1
Maximum containers10

Single container (maximum = 1): More cost-effective, but your application will experience downtime if the container fails. This mode is suitable for development and testing environments.

Multiple containers (maximum > 1): Can provide high availability for production environments, but only if your Go application is properly designed for it. Each container runs on a different physical server for redundancy. Your application must be stateless and avoid storing data in local files to work properly across multiple containers.

Read More

More details on horizontal scaling.

Advanced settings​

Start CPU cores: Determines how many CPU cores are allocated during application startup. Increase this value if your Go application starts slowly or requires more processing power during initialization.

For dedicated CPU mode, you can also configure:

  • Min free CPU %: Triggers scaling when free CPU drops below this percentage of a single core
  • Dynamic free total %: Triggers scaling when total free CPU across all cores drops below this percentage
Read More

More details on CPU Scaling Thresholds.

RAM thresholds: Help prevent out-of-memory crashes by maintaining buffer space:

  • Absolute (GB): Maintains this amount of free RAM at all times
  • Percentage: Keeps this percentage of total RAM free

Consider increasing these values if your application experiences memory-related crashes.

Read More

More details on RAM Scaling Thresholds.

Monitor usage​

Navigate to your service and select Service dashboard & runtime containers to view:

  • CPU, RAM, and disk usage over time
  • Number of active containers
  • Historical scaling events
Read More

Learn about monitoring your infrastructure in detail.

Common issues​

Out of memory crashes

  • Increase the minimum free RAM settings in your scaling configuration
  • Review your code for potential memory leaks

Higher than expected costs

  • Consider lowering your maximum resource limits

Application issues with multiple containers

  • Remove dependencies on local file storage (use external storage services instead)
  • Implement session management that works across containers (consider using Redis or external session stores)
  • Ensure your application is designed to be stateless

Slow application startup

  • Increase the "Start CPU cores" setting in your scaling configuration
  • Consider switching to dedicated CPU mode for more consistent performance
Read More

More troubleshooting tips: Scaling Troubleshooting.

Have questions? Join our Discord community for help!