Skip to main content
Version: Next

Enable parallel processing

In cluster mode, you can specify the parallelism (the number of instances to run) to enable parallel processing for a function.

Example1

Specify the --parallelism flag of the create command when deploying a function.

bin/pulsar-admin functions create \
--parallelism 3 \
# Other function info
tip

For an existing function, you can adjust the parallelism by using the update command.

Example2

Specify the parallelism parameter when deploying a function configuration through YAML.

# function-config.yaml
parallelism: 3
inputs:
- persistent://public/default/input-1
output: persistent://public/default/output-1
# other parameters

For an existing function, you can adjust the parallelism by using the update command as follows.

bin/pulsar-admin functions update \
--function-config-file $PWD/function-config.yaml