Skip to main content

Rescaling your Flink job

Rescaling

A running Job can be rescaled by changing the resources assigned to it. Immerok Cloud will restart the Job automatically with a new parallelism based on the resources provided. A rescaling operation does incur downtime. The length of this downtime depends primarily on the size of the application state. Rescaling can happen as quickly as a second for Jobs with small state.

Rescaling with scale

Rescaling via rok scale is the easiest way to rescale a running Job.


_13
$ rok get job my-job -o yaml
_13
apiVersion: core/v1alpha1
_13
kind: Job
_13
zone: shared-aws-eu-west-1
_13
metadata:
_13
name: my-job
_13
project: default
_13
spec:
_13
flinkVersion: 1.16
_13
artifactRef:
_13
name: my-job-artifact
_13
resources:
_13
rpus: 5


_3
$ rok scale job my-job --rpus 7
_3
_3
✔ Triggered rescaling for Job "my-job" to 7 RPUs.


_13
$ rok get job my-job -o yaml
_13
apiVersion: core/v1alpha1
_13
kind: Job
_13
zone: shared-aws-eu-west-1
_13
metadata:
_13
name: my-job
_13
project: default
_13
spec:
_13
flinkVersion: 1.16
_13
artifactRef:
_13
name: my-job-artifact
_13
resources:
_13
rpus: 7

Rescaling with apply

If you manage your Jobs with rok apply in a declarative way rescaling just translates to editing your Job and applying the configuration with rok apply.

job.yaml

_12
apiVersion: core/v1alpha1
_12
kind: Job
_12
zone: shared-aws-eu-west-1
_12
metadata:
_12
name: my-job
_12
project: default
_12
spec:
_12
flinkVersion: 1.16
_12
artifactRef:
_12
name: my-job-artifact
_12
resources:
_12
rpus: 7


_3
$ rok apply -f job.yaml
_3
_3
✔ Job "my-job" has been updated.