Configure thread runtime

You can use the default configurations of thread runtime in the conf/functions_worker.yml file.

If you want to customize more parameters, such as thread group name, refer to the following example.

  1. functionRuntimeFactoryClassName: org.apache.pulsar.functions.runtime.thread.ThreadRuntimeFactory
  2. functionRuntimeFactoryConfigs:
  3. threadGroupName: "Your Function Container Group"

To set the client memory limit for thread runtime, you can configure pulsarClientMemoryLimit.

  1. functionRuntimeFactoryConfigs:
  2. # pulsarClientMemoryLimit
  3. # # the max memory in bytes the pulsar client can use
  4. # absoluteValue:
  5. # # the max memory the pulsar client can use as a percentage of max direct memory set for JVM
  6. # percentOfMaxDirectMemory:

Configure thread runtime - 图1note

If absoluteValue and percentOfMaxDirectMemory are both set, the smaller value is used.

For more details, see code.