这是indexloc提供的服务,不要输入任何密码
Skip to content
/ scalsun Public

Free and Open Source. Tool for auto-scaling of Upsun projects. DISCLAIMER: This is not an official Upsun product and does not qualify for Upsun support.

License

Notifications You must be signed in to change notification settings

upsun/scalsun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScalSun

This tool provide simple auto-scaling on upsun project.

Usage/install

Deploy the scalsun and Upsun CLI binary into your project

On .upsun/config
Add to build hook :

    hook:
        build: |
            mkdir bin
            curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | VENDOR=upsun bash
            curl -fsSL https://github.com/upsun/scalsun/releases/download/v0.3.0/scalsun-v0.3.0-linux-amd64.tar.gz | tar -xzf - -c bin

Add cron task every minute :

    crons:
        autoscaller:
            spec: "*/1 * * * *"
            commands:
                start: |
                    if [ "$PLATFORM_ENVIRONMENT_TYPE" = "production" ]; then
                        /app/bin/scalsun --silent --max_host_count=${H_SCALING_HOST_MAX:-3}
                    fi

On Upsun console,
Add a environment variables with your token :

env:UPSUN_CLI_TOKEN

Syntax

Usage of scalsun:
      --name string                     Apps or Service name
      --min_host_count: int             Minimum host count (default 1)
      --max_host_count int              Maximum host count (default 3)
      --min_cpu_usage_upscale float     Minimum CPU usage in % (for upscale event only) (default 75.0)
      --max_cpu_usage_downscale float   Maximum CPU usage in % (for downscale event only) (default 60.0)
      --min_mem_usage_upscale float     Minimum memory usage in % (for upscale event only) (default 80.0)
      --max_mem_usage_downscale float   Maximum memory usage in % (for downscale event only) (default 20.0)
  -v, --verbose                         Enable verbose mode
  -s, --silent                          Enable silent mode

Samples

  • Auto-scale all app/service
    scalsun --silent --max_host_count=${H_SCALING_HOST_MAX:-3}
  • Auto-scale only specific app (if app name is web)
    scalsun --silent --max_host_count=${H_SCALING_HOST_MAX:-3} --name=web

About

Free and Open Source. Tool for auto-scaling of Upsun projects. DISCLAIMER: This is not an official Upsun product and does not qualify for Upsun support.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages