Runtime Processes

These are the processes required for your application. When you add an application, if you do not specify the start command for the web process, Kinsta attempts to automatically detect the required start command during the first deployment. For example, the start command for a Node.js application may be npm start or yarn start. This cannot be removed, and you can only have one web process per application.

You can also edit and define your own commands in MyKinsta in the Processes section of your application. You can see an example of this in our Example Deployment.

In addition to the web process, you can add background processes/workers. There is no limit to the number of processes you can add; however, each process requires at least one pod to run.

You can change the size of your pod (vertical scaling) and change how many pods are run at the same time (horizontal scaling).

  • Vertical scaling is great for giving pods more power to complete resource-intensive tasks.
  • Horizontal scaling is great for resilience and load balancing for applications that process a lot of requests. For example, you could run 3 versions of the same pod. The underlying technology routes requests to one of the three pods, effectively distributing the load between them. If one pod becomes unstable, requests will route to the other two until the third pod is healthy again.
Application runtime processes and build process in MyKinsta.
Application runtime processes and build process in MyKinsta.

Defining Processes in MyKinsta

When deploying an application, as described above, you can set a web process command, or you can let Kinsta set the default command. You can also edit and define your own commands in MyKinsta in the Processes section of your application. You can see an example of this in our Example Deployment.

To add a new process, click Create process and complete the fields as follows:

  • Name: The process name, for example, “Worker”.
  • Type: Background job.
  • Start command: The command required to start the process, for example, npm run [process].
  • Pod size: Choose the CPU and RAM dedicated to the process.
  • Instances: The number of instances required, up to a maximum of five. Each instance represents one pod, and the instances all use the same pod size. You cannot define a different pod size for each instance.

You can change the details of any process, including the Pod size, at any time. Any changes you make, with the exception of the name, automatically triggers the rollout process for the application.

Build Process

This shows you the build machine the build process is using. Clicking Update build allows you to change the build resources used for the build process.

Defining Processes in a Procfile

Procfiles define processes from your application’s code and should be committed to your repository. A Procfile contains one process per line in the following format:

process_name: command

For example, to run a Laravel application, you might want to use the following:

web: php artisan serve --host 0.0.0.0 --port 8080

If you are using a Procfile, you will need to define a process named web to ensure the container will fulfill web requests.