Thanks to visit codestin.com
Credit goes to fixed.docs.upsun.com

Platform.sh is now Upsun. Click here to learn more
Upsun Fixed User Documentation

workers

Try Upsun for 15 days
After that, enjoy the same game-changing Upsun features for less with the First Project Incentive!¹ A monthly $19 perk!
Activate your 15-day trial
¹Terms and conditions apply. Only for Flexible Resource projects.

Defines the list of worker names, which are alternate copies of the application to run as background processes.

Optional in single-runtime and composable images.

Using workers in your project requires a Medium plan or larger to ensure adequate resource allocation.

Workers are exact copies of the code and compilation output as a web instance after a build hook. They use the same container image.

Workers can’t accept public requests and so are suitable only for background tasks. If they exit, they’re automatically restarted.

The keys of the workers definition are the names of the workers. You can then define how each worker differs from the web instance using the top-level properties.

Each worker can differ from the web instance in all properties except for:

  • build and dependencies properties, which must be the same
  • crons as cron jobs don’t run on workers
  • hooks as the build hook must be the same and the deploy and post_deploy hooks don’t run on workers.

A worker named queue that was small and had a different start command could look like this:

.platform.app.yaml
applications:
  APP_NAME:
    type: 'python:3.13'
    source:
      root: "/"
    workers:
      queue:
        size: S
        commands:
          start: |
            ./worker.sh                    

The keys of the workers definition are the names of the workers. You can then define how each worker differs from the web instance using the top-level properties.

Each worker can differ from the web instance in all properties except for:

  • crons as cron jobs don’t run on workers
  • hooks as the build hook must be the same and the deploy and post_deploy hooks don’t run on workers.

A worker named queue that was small and had a different start command could look like this:

.platform.app.yaml
applications:
  APP_NAME:
    type: "composable:25.05"
    source:
      root: "/"
    stack: 
      runtimes: [ "[email protected]" ]
    workers:
      queue:
        size: S
        commands:
          start: |
            ./worker.sh