Scale

sfp server scale

Scale worker services for a tenant

sfp server scale

Adjust the number of worker instances for different queue priorities to handle varying workloads.

USAGE
  $ sfp server scale -t <value> [--json] [--passphrase <value>
    [--identity-file <value> --ssh-connection <value>]] [--critical-workers
    <value>] [--normal-workers <value>] [--batch-workers <value>] [-g
    <value>...] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -t, --tenant=<value>              (required) Name of the tenant
  --critical-workers=<value>        Number of critical queue workers (1-10)
  --normal-workers=<value>          Number of normal queue workers (1-10)
  --batch-workers=<value>           Number of batch queue workers (1-10)
  
  SSH OPTIONS
  --ssh-connection=<value>          SSH connection string in the format user@host[:port]
  --identity-file=<value>           Path to SSH private key file
  --passphrase=<value>              Passphrase for the SSH private key if required
  
  OTHER OPTIONS
  --json                            Format output as json
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs
  --loglevel=<option>               [default: info] logging level for this command invocation
                                    <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>

DESCRIPTION
  Scale worker services for a tenant

  Worker Types:
  - Critical Workers: Handle high-priority, time-sensitive tasks (auth, critical operations)
  - Normal Workers: Process standard operations and deployments
  - Batch Workers: Execute background jobs, scheduled tasks, and non-urgent operations

  Each worker type can be scaled independently from 1 to 10 instances.

EXAMPLES
  $ sfp server scale --tenant my-app --critical-workers 2

  $ sfp server scale --tenant my-app --normal-workers 3

  $ sfp server scale --tenant my-app --batch-workers 2

  $ sfp server scale --tenant my-app --critical-workers 2 --normal-workers 3 --batch-workers 2

  $ sfp server scale --tenant my-app --critical-workers 2 --ssh-connection [email protected] --identity-file ~/.ssh/id_rsa

Worker Types

Critical Workers

Handle high-priority, time-sensitive operations:

  • Authentication requests

  • Security operations

  • System-critical tasks

  • Real-time notifications

Normal Workers

Process standard operations:

  • Package deployments

  • Build operations

  • Standard API requests

  • Regular task processing

Batch Workers

Execute background and scheduled tasks:

  • Report generation

  • Data cleanup

  • Scheduled maintenance

  • Long-running operations

Scaling Strategies

Scale Up for High Load

Increase workers during peak times:

Scale Down for Maintenance

Reduce workers for maintenance:

Gradual Scaling

Scale workers gradually to test capacity:

Output Formats

Standard Output

JSON Output

Remote Server Scaling

Scale workers on a remote server:

Scaling Recommendations

Based on Load Patterns

Light Load (< 100 operations/hour):

Medium Load (100-1000 operations/hour):

Heavy Load (> 1000 operations/hour):

Auto-Scaling Script

Performance Monitoring

Monitor worker performance after scaling:

Best Practices

  1. Start Conservative: Begin with fewer workers and scale up as needed

  2. Monitor After Scaling: Always check status after scaling operations

  3. Consider Queue Depth: Scale based on queue backlog, not just time

  4. Balance Worker Types: Ensure appropriate ratio between worker types

  5. Plan for Peaks: Pre-scale before expected high-load periods

Troubleshooting

Workers Not Starting

High Memory Usage

Note: Worker scaling changes take effect immediately but may take a few moments for all instances to be fully operational.

Warning: Scaling down workers will gracefully shutdown excess instances, but any running tasks will be completed first.

Last updated