Getting started / Reference /
Processes

Processes

Overview

Processes are individual containerized services that make up your Tapitalee application. Each process represents a specific function or component of your application, such as a web server, API service, background worker, or database proxy. Processes provide fine-grained control over scaling, resource allocation, and deployment configuration.

Purpose and Benefits

  • Service Isolation: Separate concerns and scale components independently
  • Resource Control: Individual CPU, memory, and scaling configuration per service
  • Fault Isolation: Failures in one process don’t affect others
  • Independent Deployment: Deploy and update processes separately
  • Specialized Configuration: Different container configurations for different workloads
  • Horizontal Scaling: Scale each service based on its specific demands

On-Demand vs Spot Instances

Each process can run a mix of on-demand and spot instances, controlled by the demand_count and spot_count parameters respectively.

On-Demand Instances

On-demand instances are standard AWS ECS Fargate tasks that start reliably and remain running until you stop them. They are the safest choice for processes that require consistent availability.

Spot Instances

Spot instances run on spare AWS capacity and cost approximately one-third of the price of on-demand instances, making them a cost-effective option for workloads that can tolerate interruptions.

However, spot instances come with trade-offs:

  • Startup delays or failures: A spot instance may take longer than usual to start, or may fail to start at all if spare capacity is unavailable.
  • Forced shutdowns: AWS can reclaim spot capacity at any time, causing instances to be shut down unexpectedly.
  • Restart delays: After a forced shutdown, a spot instance may not be able to restart immediately — it must wait for spare capacity to become available again.

Spot instances are well-suited for background workers, batch jobs, or any process where occasional interruptions are acceptable.

Taking a Process Offline

You can set both demand_count and spot_count to 0, which stops all running instances and takes the process effectively offline. However, the preferred ways to stop a process are:

  • Set disabled=true via the CLI: tapit set process name=<process> disabled=true
  • Toggle the process Off in the Tapitalee web UI

Using the disabled flag (or the web UI toggle) is cleaner than setting counts to zero, as it preserves your previous instance counts so they can be restored when you re-enable the process.

CLI Usage

Create Process

Create a new process type (e.g., worker, scheduler) for the app

tapit create process name=process_name [memory|cpu|demand_count|spot_count|scale_count|scale_type|command|image|autoscaling_cpu_threshold|ephemeral_storage_gb|allowed_ip_ranges]=value [--ignore-existing]

Parameters

  • name: Name for the process (required, alphanumeric with hyphens, e.g., worker)
  • memory: Memory allocation in GB (default: 0.5)
  • cpu: CPU allocation in vCPUs (default: 0.25)
  • demand_count: Number of on-demand container instances
  • spot_count: Number of spot container instances
  • scale_count: Number of extra instances to add when scaling up
  • scale_type: Instance type used when scaling up: none (default, disables autoscaling), spot, or demand
  • command: Override the default container command
  • image: Custom Docker image (overrides app image)
  • autoscaling_cpu_threshold: CPU % threshold to trigger autoscaling
  • ephemeral_storage_gb: Ephemeral storage in GB (default: 20)
  • allowed_ip_ranges: IP address, CIDR ranges, or special values app/vpc/all, that are allowed to access the instance, separated by commas
  • --ignore-existing: Skip creation if a resource with the same name already exists (useful for idempotent scripts)

Examples

# Basic web process
tapit create process name=default

# API service with more resources
tapit create process name=api memory=2.0 cpu=1.0 demand_count=3 spot_count=0

# Background worker
tapit create process name=worker memory=1.0 cpu=0.5 demand_count=1 spot_count=2 command="python worker.py"

# Microservice with custom image
tapit create process name=auth-service image=myapp/auth:latest memory=0.5 cpu=0.25 demand_count=2

Modify Process Configuration

Update settings for an existing process type

tapit set process [name=process_name] [memory|cpu|demand_count|spot_count|scale_count|scale_type|command|image|disabled|autoscaling_cpu_threshold|ephemeral_storage_gb|allowed_ip_ranges]=value

Parameters

  • name: Name of the process to update (default: default process)
  • memory: Memory allocation in GB (default: 0.5)
  • cpu: CPU allocation in vCPUs (default: 0.25)
  • demand_count: Number of on-demand container instances
  • spot_count: Number of spot container instances
  • scale_count: Number of extra instances to add when scaling up
  • scale_type: Instance type used when scaling up: none (default, disables autoscaling), spot, or demand
  • command: Override the default container command
  • image: Custom Docker image (overrides app image); set to empty string to revert to the app’s default deployment image
  • disabled: Turn off (true) or on (false) the process
  • autoscaling_cpu_threshold: CPU % threshold to trigger autoscaling
  • ephemeral_storage_gb: Ephemeral storage in GB (default: 20)
  • allowed_ip_ranges: IP address, CIDR ranges, or special values app/vpc/all, that are allowed to access the instance, separated by commas

Examples

# Scale up web process
tapit set process name=default desired_count=5

# Add more memory to worker
tapit set process name=worker memory=2.0

# Update command for background process
tapit set process name=scheduler command="python manage.py run_scheduler"

# Disable process temporarily
tapit set process name=worker disabled=true

# Re-enable process
tapit set process name=worker disabled=false

# Update to new image version
tapit set process name=api image=myapp/api:v2.1.0

Restart Process

Restart a running process by forcing new container instances to replace current ones

tapit restart process name=process_name

Parameters

  • name: Name of the process to restart (required)

Performs a rolling restart of all instances of the specified process.

Examples

# Restart web servers
tapit restart process name=default

# Restart background workers
tapit restart process name=worker

Show Process Details

Show detailed configuration and state for a specific process

tapit show process name=process_name

Parameters

  • name: Name of the process to show (required)

List Processes

List all process types for the app with their resource allocations and state

tapit list processes

Delete Process

Delete a process type and its associated infrastructure

tapit delete process name=process_name

Parameters

  • name: Name of the process to delete (required; cannot delete the default process)

Examples

# Delete unused process
tapit delete process name=old-worker

# Clean up test process
tapit delete process name=test-api

Process Types and Patterns

Web Process

Handles HTTP requests and serves web traffic:

tapit create process name=default memory=1.0 cpu=0.5 demand_count=3 spot_count=1

Examples

Custom Commands

# Web server
tapit create process name=default command="npm start"

# Worker with specific script
tapit create process name=worker command="python -m celery worker -A app"

# Migration runner
tapit create process name=migrate command="python manage.py migrate" demand_count=1