Rate This Document
Findability
Accuracy
Completeness
Readability

Managing Resources

haf-tool supports resource management in two modes for the HAF service on offload nodes: querying the resource configuration and configuring resources.

Querying the Resource Configuration

To query the resource configuration, run the following command:

/home/omm/haf-install/haf-target/tools/haf-tool resource -r <resource_target>

Table 1 Parameter description

Option

Description

Mandatory

-r target resource/--resource=target resource

target resource indicates the resource object. The value can be daemon or the name of a deployed service.

No

  • If -r is not specified, the configurations of all resources are queried.
  • If -r is specified, the configuration of the specified resource is queried.

Configuring Resources

To configure resources, run the following command:

/home/omm/haf-install/haf-target/tools/haf-tool resource -r <resource_target> -c <cpu> -m <mem>

Table 2 Parameter description

Option

Description

Mandatory

-r <resource_target>/--resource=<resource_target>

<resource_target> indicates the resource to be modified. The value can be daemon or the name of a deployed service.

Yes

-c <cpu limit>/--cpu=<cpu limit>

Set the CPU limit. The maximum number of daemons is 4, and the maximum number of haf_user is the total number of CPU cores. The CPU resource can be configured independently. -1 indicates that the CPU usage is not limited.

No

-m <memory limit>/--mem=<memory limit>

Set the memory limit. The maximum value is the total memory of the current node, in MB. The memory can be configured independently. -1 indicates that the memory usage is not limited.

No

  • Set the CPU resource limit. Use CGROUP to set HAF processes and HAF application service resources.
  • HAF creates a haf directory in the subdirectories described in Prerequisites for Deployment. The haf directory contains the daemon and haf_user folders, which are used to manage CPU resources of daemons and executors. When the service is uninstalled, the directory is not deleted. If you redeploy the service and the directory exists, you can directly use this directory.